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

Commit b17d866

Browse files
committed
Generalized Quoted-ISA rules to compensate parsing mistakes.
1 parent c246541 commit b17d866

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<groupId>org.lambda3.text.simplification</groupId>
2828
<artifactId>discourse-simplification</artifactId>
29-
<version>7.1.0-SNAPSHOT</version>
29+
<version>7.1.0</version>
3030
<packaging>jar</packaging>
3131

3232
<name>Discourse Simplification</name>

src/main/java/org/lambda3/text/simplification/discourse/tree/extraction/rules/QuotedISAPostExtractor.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,19 @@ public class QuotedISAPostExtractor extends ExtractionRule {
4848

4949
@Override
5050
public Optional<Extraction> extract(Tree parseTree) {
51-
TregexPattern p = TregexPattern.compile("ROOT <<: (S < (S=s < (NP $.. VP) ?,, (/``/=startOut) ?<<, (/``/=startIn) ?<<- (/''/=endIn) ?.. (/''/=endOut) $.. (NP $.. VP)))");
51+
TregexPattern p = TregexPattern.compile("ROOT <<: (S << (/``/=start .. (NP .. (/VB./ .. (/''/=end .. (NP .. VP))))))");
5252
TregexMatcher matcher = p.matcher(parseTree);
5353

5454
while (matcher.findAt(parseTree)) {
5555
Tree quoteStart;
56-
if (matcher.getNode("startOut") != null) {
57-
quoteStart = matcher.getNode("startOut");
58-
} else if (matcher.getNode("startIn") != null) {
59-
quoteStart = matcher.getNode("startIn");
56+
if (matcher.getNode("start") != null) {
57+
quoteStart = (matcher.getNode("start"));
6058
} else {
6159
continue;
6260
}
6361
Tree quoteEnd;
64-
if (matcher.getNode("endOut") != null) {
65-
quoteEnd = matcher.getNode("endOut");
66-
} else if (matcher.getNode("endIn") != null) {
67-
quoteEnd = matcher.getNode("endIn");
62+
if (matcher.getNode("end") != null) {
63+
quoteEnd = matcher.getNode("end");
6864
} else {
6965
continue;
7066
}

src/main/java/org/lambda3/text/simplification/discourse/tree/extraction/rules/QuotedISAPreExtractor.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,19 @@ public class QuotedISAPreExtractor extends ExtractionRule {
4949

5050
@Override
5151
public Optional<Extraction> extract(Tree parseTree) {
52-
TregexPattern p = TregexPattern.compile("ROOT <<: (S < (NP $.. (VP <+(VP) (S=s < (NP $.. VP) ?,, (/``/=startOut) ?<<, (/``/=startIn) ?<<- (/''/=endIn) ?.. (/''/=endOut)))))");
52+
TregexPattern p = TregexPattern.compile("ROOT <<: (S << (NP .. (VP .. (/``/=start .. (NP .. (/VB./ .. (/''/=end)))))))");
5353
TregexMatcher matcher = p.matcher(parseTree);
5454

5555
while (matcher.findAt(parseTree)) {
5656
Tree quoteStart;
57-
if (matcher.getNode("startOut") != null) {
58-
quoteStart = matcher.getNode("startOut");
59-
} else if (matcher.getNode("startIn") != null) {
60-
quoteStart = matcher.getNode("startIn");
57+
if (matcher.getNode("start") != null) {
58+
quoteStart = (matcher.getNode("start"));
6159
} else {
6260
continue;
6361
}
6462
Tree quoteEnd;
65-
if (matcher.getNode("endOut") != null) {
66-
quoteEnd = matcher.getNode("endOut");
67-
} else if (matcher.getNode("endIn") != null) {
68-
quoteEnd = matcher.getNode("endIn");
63+
if (matcher.getNode("end") != null) {
64+
quoteEnd = matcher.getNode("end");
6965
} else {
7066
continue;
7167
}

0 commit comments

Comments
 (0)