forked from GitHub/gf-core
the semantic graph view in the app now shows the real number of senses
This commit is contained in:
@@ -21,10 +21,10 @@ public class SemanticGraph {
|
|||||||
layoutMaxY = 0;
|
layoutMaxY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Node addNode(String lemma) {
|
public Node addNode(String lemma, List senses) {
|
||||||
Node n = nodes.get(lemma);
|
Node n = nodes.get(lemma);
|
||||||
if (n == null) {
|
if (n == null) {
|
||||||
n = new Node(lemma, new String[(int) (10*Math.random())]);
|
n = new Node(lemma, senses);
|
||||||
}
|
}
|
||||||
nodes.put(lemma,n);
|
nodes.put(lemma,n);
|
||||||
return n;
|
return n;
|
||||||
@@ -182,7 +182,7 @@ public class SemanticGraph {
|
|||||||
|
|
||||||
public static class Node {
|
public static class Node {
|
||||||
private String lemma;
|
private String lemma;
|
||||||
private String[] senses;
|
private List senses;
|
||||||
|
|
||||||
private float layoutPosX;
|
private float layoutPosX;
|
||||||
private float layoutPosY;
|
private float layoutPosY;
|
||||||
@@ -190,7 +190,7 @@ public class SemanticGraph {
|
|||||||
private float layoutForceY;
|
private float layoutForceY;
|
||||||
|
|
||||||
|
|
||||||
private Node(String lemma, String[] senses) {
|
private Node(String lemma, List senses) {
|
||||||
this.lemma = lemma;
|
this.lemma = lemma;
|
||||||
this.senses = senses;
|
this.senses = senses;
|
||||||
|
|
||||||
@@ -205,11 +205,11 @@ public class SemanticGraph {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getSenseCount() {
|
public int getSenseCount() {
|
||||||
return senses.length;
|
return senses.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSenseId(int i) {
|
public Object getSenseId(int i) {
|
||||||
return senses[i];
|
return senses.get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getLayoutX() {
|
public float getLayoutX() {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class SemanticGraphActivity extends Activity {
|
|||||||
Toast toast = Toast.makeText(this, "\""+query+"\" doesn't match", Toast.LENGTH_SHORT);
|
Toast toast = Toast.makeText(this, "\""+query+"\" doesn't match", Toast.LENGTH_SHORT);
|
||||||
toast.show();
|
toast.show();
|
||||||
} else {
|
} else {
|
||||||
mGraphView.getGraph().addNode(query);
|
mGraphView.getGraph().addNode(query, list);
|
||||||
mGraphView.refresh();
|
mGraphView.refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user