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

Commit 6d9b6f7

Browse files
author
Christina
committed
add rules
2 parents 39c557b + d4d938f commit 6d9b6f7

File tree

7 files changed

+218
-3
lines changed

7 files changed

+218
-3
lines changed

.gitignore

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
2+
.idea/misc.xml
3+
.idea/dictionaries
4+
5+
# Created by https://www.gitignore.io/api/intellij,jetbrains,java,maven,eclipse
6+
7+
### Eclipse ###
8+
9+
.metadata
10+
bin/
11+
tmp/
12+
*.tmp
13+
*.bak
14+
*.swp
15+
*~.nib
16+
local.properties
17+
.settings/
18+
.loadpath
19+
.recommenders
20+
21+
# Eclipse Core
22+
.project
23+
24+
# External tool builders
25+
.externalToolBuilders/
26+
27+
# Locally stored "Eclipse launch configurations"
28+
*.launch
29+
30+
# PyDev specific (Python IDE for Eclipse)
31+
*.pydevproject
32+
33+
# CDT-specific (C/C++ Development Tooling)
34+
.cproject
35+
36+
# JDT-specific (Eclipse Java Development Tools)
37+
.classpath
38+
39+
# Java annotation processor (APT)
40+
.factorypath
41+
42+
# PDT-specific (PHP Development Tools)
43+
.buildpath
44+
45+
# sbteclipse plugin
46+
.target
47+
48+
# Tern plugin
49+
.tern-project
50+
51+
# TeXlipse plugin
52+
.texlipse
53+
54+
# STS (Spring Tool Suite)
55+
.springBeans
56+
57+
# Code Recommenders
58+
.recommenders/
59+
60+
### Intellij ###
61+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
62+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
63+
64+
# User-specific stuff:
65+
.idea/workspace.xml
66+
.idea/tasks.xml
67+
68+
# Sensitive or high-churn files:
69+
.idea/dataSources/
70+
.idea/dataSources.ids
71+
.idea/dataSources.xml
72+
.idea/dataSources.local.xml
73+
.idea/sqlDataSources.xml
74+
.idea/dynamic.xml
75+
.idea/uiDesigner.xml
76+
77+
# Gradle:
78+
.idea/gradle.xml
79+
.idea/libraries
80+
81+
# Mongo Explorer plugin:
82+
.idea/mongoSettings.xml
83+
84+
## File-based project format:
85+
*.iws
86+
87+
## Plugin-specific files:
88+
89+
# IntelliJ
90+
/out/
91+
92+
# mpeltonen/sbt-idea plugin
93+
.idea_modules/
94+
95+
# JIRA plugin
96+
atlassian-ide-plugin.xml
97+
98+
# Crashlytics plugin (for Android Studio and IntelliJ)
99+
com_crashlytics_export_strings.xml
100+
crashlytics.properties
101+
crashlytics-build.properties
102+
fabric.properties
103+
104+
### Intellij Patch ###
105+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
106+
107+
# *.iml
108+
# modules.xml
109+
# .idea/misc.xml
110+
# *.ipr
111+
112+
### Java ###
113+
*.class
114+
115+
# BlueJ files
116+
*.ctxt
117+
118+
# Mobile Tools for Java (J2ME)
119+
.mtj.tmp/
120+
121+
# Package Files #
122+
*.jar
123+
*.war
124+
*.ear
125+
126+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
127+
hs_err_pid*
128+
129+
### JetBrains ###
130+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
131+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
132+
133+
# User-specific stuff:
134+
135+
# Sensitive or high-churn files:
136+
137+
# Gradle:
138+
139+
# Mongo Explorer plugin:
140+
141+
## File-based project format:
142+
143+
## Plugin-specific files:
144+
145+
# IntelliJ
146+
147+
# mpeltonen/sbt-idea plugin
148+
149+
# JIRA plugin
150+
151+
# Crashlytics plugin (for Android Studio and IntelliJ)
152+
153+
### JetBrains Patch ###
154+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
155+
156+
# *.iml
157+
# modules.xml
158+
# .idea/misc.xml
159+
# *.ipr
160+
161+
### Maven ###
162+
target/
163+
pom.xml.tag
164+
pom.xml.releaseBackup
165+
pom.xml.versionsBackup
166+
pom.xml.next
167+
release.properties
168+
dependency-reduced-pom.xml
169+
buildNumber.properties
170+
.mvn/timing.properties
171+
172+
# Exclude maven wrapper
173+
!/.mvn/wrapper/maven-wrapper.jar
174+
175+
# End of https://www.gitignore.io/api/intellij,jetbrains,java,maven,eclipse

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: java
2+
script: mvn test -B
3+
jdk: oraclejdk8
4+
cache:
5+
directories:
6+
- "$HOME/.m2"
7+
before_install:
8+
- "./install-SentenceSimplification.sh"
9+
notifications:
10+
slack:
11+
on_success: always
12+
on_failure: always
13+
rooms:
14+
secure: Qm58N3+AWkVzecoZgtI6FuQoQOVEfEr6+dOUkCjB6VzUt0ZzkKn+tkdE60nqPJIHAzLFCH5Fm8njyQgNZqv027V8nL12x/b45KLYDZjEauaMLV9Wh7K5QkQuV31/u1hX46Dkkb6sUR8viXKQZ042xFRqWKR0bDaxA3Fzu2NEJuaPgc5lUriCTe27BqQsBxg+ti2jyseHfWHw8qc6ANgk/gkq3v3mg08o46xD2cY5BFEsfUji7RS3bgiUh4H0vuwmVBzf3ZFUpBpcCbpN5E7RMnNInDAxEVUueBmlQfCRFyLnxbdmIFBmyYpFzv6eZtDNCLWXO0lbX+uFhD8Id0Yr0rKADdYtPb2Mrx8PwrxQ00XPSRaqXDL3AODkXL4SODPHDtJ766ATUBO1JCcO26p0PuAaqEaNf3UBlWrtg4mQpN3GV4lQT0F1O609U0vQy1/SAbWRBTmXahY3X+0Hkugs65Ui7Rd87wpTJhGuuVbqXZx1iWvFqDB3SYhTt4TzCJLaY2HlQumtr0+vcjfaxet4owS3myilOctHw8bMnnqpdMwwuwKWrI3PTQWuzcsMdfaIYx60GHQi8tKZEiu24RBpsuKmT0drYbR2RCkAmRFavkCgSn1aBxXdEdXnXawZPzddDMmqzCRpnVbGw+7WE/AT9ZZaCDJjwukVNuFmxc9+OMQ=

src/main/java/org/lambda3/text/simplification/discourse/App.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ private static void saveLines(File file, List<String> lines) {
5151
}
5252

5353
public static void main(String[] args) throws IOException {
54-
55-
SimplificationContent content = DISCOURSE_SIMPLIFIER.doDiscourseSimplification(new File("obama_wiki_en_split.txt"), ProcessingType.SEPARATE, true);
54+
55+
SimplificationContent content = DISCOURSE_SIMPLIFIER.doDiscourseSimplification(new File("input.txt"), ProcessingType.SEPARATE, true);
5656
content.serializeToJSON(new File("output.json"));
5757
saveLines(new File("output_default.txt"), Arrays.asList(content.defaultFormat(false)));
5858
saveLines(new File("output_flat.txt"), Arrays.asList(content.flatFormat(false)));

src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/Relation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public enum Relation {
5757
TEMPORAL_TIME, // indicating a particular instance on a time scale (e.g. “Next Sunday 2 pm”).
5858
TEMPORAL_DURATION, // the amount of time between the two end-points of a time interval (e.g. “2 weeks").
5959
TEMPORAL_DATE, // particular date (e.g. “On 7 April 2013”).
60+
<<<<<<< HEAD
6061
TEMPORAL_SET, IDENTIFYING_DEFINITION, DESCRIBING_DEFINITION; // periodic temporal sets representing times that occur with some frequency (“Every Tuesday”).
62+
=======
63+
TEMPORAL_SET; // periodic temporal sets representing times that occur with some frequency (“Every Tuesday”).
64+
>>>>>>> d4d938f9778712a34ecc3e3335094b9e92a9c746
6165

6266
static {
6367
UNKNOWN_COORDINATION.coordination = true;

src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/ExtractionRule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ protected static List<Word> rephraseEnablement(Tree s, Tree vp) {
185185

186186
return res;
187187
}
188+
188189

189190
protected static String rephraseApposition(Tree vp, String np) {
190191
String res = "";
@@ -231,6 +232,7 @@ protected static List<Word> rephraseAppositionNonRes(Tree vp, Tree np, Tree np2)
231232
return res;
232233
}
233234

235+
234236
protected static List<Word> getRephrasedParticipalS(Tree np, Tree vp, Tree s, Tree vbgn) {
235237
Number number = getNumber(np);
236238
Tense tense = getTense(vp);

src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/rules/SharedNPPostParticipalExtractor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,14 @@ public Optional<Extraction> extract(Leaf leaf) throws ParseTreeException {
5454
while (matcher.findAt(leaf.getParseTree())) {
5555
List<Word> cuePhraseWords = ParseTreeExtractionUtils.getPrecedingWords(matcher.getNode("node"), matcher.getNode("s"), false);
5656

57+
5758
// the left, superordinate constituent
5859
List<Word> leftConstituentWords = new ArrayList<>();
59-
leftConstituentWords.addAll(ParseTreeExtractionUtils.getPrecedingWords(leaf.getParseTree(), matcher.getNode("node"), false));
60+
// leftConstituentWords.addAll(ParseTreeExtractionUtils.getPrecedingWords(leaf.getParseTree(), matcher.getNode("node"), false));
61+
62+
63+
// the left, superordinate constituent
64+
leftConstituentWords.addAll(ParseTreeExtractionUtils.getPrecedingWords(leaf.getParseTree(), matcher.getNode("s"), false));
6065
leftConstituentWords.addAll(ParseTreeExtractionUtils.getFollowingWords(leaf.getParseTree(), matcher.getNode("s"), false));
6166
Leaf leftConstituent = new Leaf(getClass().getSimpleName(), WordsUtils.wordsToProperSentenceString(leftConstituentWords));
6267

src/main/resources/reference.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ discourse-simplification {
88
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.ReferenceMedialAdverbialExtractor,
99
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.ReferenceFinalAdverbialExtractor,
1010
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.CoordinationExtractor,
11+
<<<<<<< HEAD
1112

1213

1314

@@ -22,12 +23,18 @@ discourse-simplification {
2223
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.NonRestrictiveAppositionExtractor,
2324
//org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.NonRestrictiveAppositionExtractorFinal,
2425
//org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.NonRestrictiveAppositionExtractorEntitySecondFinal,
26+
=======
27+
>>>>>>> d4d938f9778712a34ecc3e3335094b9e92a9c746
2528

2629
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.PurposePreExtractor,
2730
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SubordinationPrePurposeExtractor,
2831
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SharedNPPreParticipalExtractor,
2932
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SubordinationPreExtractor,
33+
<<<<<<< HEAD
3034

35+
=======
36+
37+
>>>>>>> d4d938f9778712a34ecc3e3335094b9e92a9c746
3138
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SharedNPPostCoordinationExtractor,
3239
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SharedNPPostParticipalExtractor,
3340
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SubordinationPostPurposeExtractor,
@@ -38,6 +45,7 @@ discourse-simplification {
3845
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SubordinationPostAttributionExtractor,
3946
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.SubordinationPostExtractor,
4047
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.QuotedAttributionPreExtractor,
48+
<<<<<<< HEAD
4149
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.PreAttributionExtractor,
4250

4351
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.ParticipialMiddleExtractor,
@@ -60,6 +68,9 @@ discourse-simplification {
6068
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.PrepositionalInitialExtractor,
6169
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.PrepositionalMiddleFinalExtractor,
6270
//org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.PrepositionalFinalExtractor,
71+
=======
72+
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.PreAttributionExtractor
73+
>>>>>>> d4d938f9778712a34ecc3e3335094b9e92a9c746
6374

6475
// should be applied last (because they dont allow further splitting)
6576
org.lambda3.text.simplification.discourse.runner.discourse_tree.extraction.rules.ListNP.PreListNPExtractor,
@@ -70,6 +81,10 @@ discourse-simplification {
7081
]
7182
attribution_verbs = ${attribution_verbs}
7283
cue_phrases = ${cue_phrases}
84+
<<<<<<< HEAD
7385
with-sentence-simplification = false
86+
=======
87+
with-sentence-simplification = true
88+
>>>>>>> d4d938f9778712a34ecc3e3335094b9e92a9c746
7489
remove-brackets = false
7590
}

0 commit comments

Comments
 (0)