Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Simpler text on dependency graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmmd committed Nov 6, 2013
1 parent a828fd4 commit 65e1c66
Showing 1 changed file with 2 additions and 14 deletions.
Expand Up @@ -16,6 +16,7 @@ import edu.knowitall.collection.immutable.graph.Graph
import edu.knowitall.collection.immutable.graph.Graph.Edge
import edu.knowitall.collection.immutable.graph.UpEdge
import edu.knowitall.tool.Format
import edu.knowitall.tool.tokenize.Tokenizer
import edu.knowitall.tool.stem.Stemmer
import edu.knowitall.tool.postag.Postagger

Expand Down Expand Up @@ -58,20 +59,7 @@ class DependencyGraph (
immutable.SortedSet[Dependency]() ++ dependencies)

/** the text of the source sentence */
val text = {
def buildString(nodes: Iterable[DependencyNode]) = {
val builder = new StringBuilder()

for (node <- nodes) {
builder.append(" " * (node.offset - builder.length))
builder.append(node.text)
}

builder.toString()
}

buildString(nodes)
}
val text = Tokenizer.originalText(this.nodes)

def canEqual(that: Any) = that.isInstanceOf[DependencyGraph]
override def equals(that: Any) = that match {
Expand Down

0 comments on commit 65e1c66

Please sign in to comment.