Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Commit 4fc82df

Browse files
committed
Included textual-properties in the serialized JSON in addition to the parse-trees.
1 parent 9b778f6 commit 4fc82df

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/main/java/org/lambda3/text/simplification/discourse/model/Element.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
package org.lambda3.text.simplification.discourse.model;
2424

25+
import com.fasterxml.jackson.annotation.JsonProperty;
2526
import edu.stanford.nlp.trees.Tree;
2627
import org.lambda3.text.simplification.discourse.utils.IDGenerator;
2728
import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeException;
@@ -85,6 +86,7 @@ public void setParseTree(Tree parseTree) {
8586
this.parseTree = parseTree;
8687
}
8788

89+
@JsonProperty("text")
8890
public String getText() {
8991
return WordsUtils.wordsToString(ParseTreeExtractionUtils.getContainingWords(parseTree));
9092
}

src/main/java/org/lambda3/text/simplification/discourse/model/SimpleContext.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
package org.lambda3.text.simplification.discourse.model;
2424

25+
import com.fasterxml.jackson.annotation.JsonProperty;
2526
import edu.stanford.nlp.trees.Tree;
2627
import org.lambda3.text.simplification.discourse.runner.discourse_tree.Relation;
2728
import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeException;
@@ -67,10 +68,6 @@ public void setParseTree(Tree parseTree) {
6768
extractPhrase();
6869
}
6970

70-
public String getText() {
71-
return WordsUtils.wordsToString(ParseTreeExtractionUtils.getContainingWords(parseTree));
72-
}
73-
7471
private void extractPhrase() {
7572
this.phrase = parseTree;
7673

@@ -102,6 +99,16 @@ public Tree getPhrase() {
10299
return phrase;
103100
}
104101

102+
@JsonProperty("text")
103+
public String getText() {
104+
return WordsUtils.wordsToString(ParseTreeExtractionUtils.getContainingWords(parseTree));
105+
}
106+
107+
@JsonProperty("phraseText")
108+
public String getPhraseText() {
109+
return WordsUtils.wordsToString(ParseTreeExtractionUtils.getContainingWords(phrase));
110+
}
111+
105112
public void setRelation(Relation relation) {
106113
this.relation = relation;
107114
extractPhrase();

0 commit comments

Comments
 (0)