Commit ae044e90a7546360b05ead3864394966a58adb55

Authored by Mateusz Kopeć
1 parent 1d1bcc9d

Deployment settings and minor fix

@@ -15,6 +15,44 @@ @@ -15,6 +15,44 @@
15 </configuration> 15 </configuration>
16 </plugin> 16 </plugin>
17 <plugin> 17 <plugin>
  18 + <artifactId>maven-source-plugin</artifactId>
  19 + <executions>
  20 + <execution>
  21 + <id>attach-sources</id>
  22 + <phase>deploy</phase>
  23 + <goals>
  24 + <goal>jar-no-fork</goal>
  25 + </goals>
  26 + </execution>
  27 + </executions>
  28 + </plugin>
  29 + <plugin>
  30 + <artifactId>maven-javadoc-plugin</artifactId>
  31 + <executions>
  32 + <execution>
  33 + <id>attach-javadocs</id>
  34 + <phase>deploy</phase>
  35 + <goals>
  36 + <goal>jar</goal>
  37 + </goals>
  38 + </execution>
  39 + </executions>
  40 + </plugin>
  41 + <plugin>
  42 + <!-- explicitly define maven-deploy-plugin after other to force exec
  43 + order -->
  44 + <artifactId>maven-deploy-plugin</artifactId>
  45 + <executions>
  46 + <execution>
  47 + <id>deploy</id>
  48 + <phase>deploy</phase>
  49 + <goals>
  50 + <goal>deploy</goal>
  51 + </goals>
  52 + </execution>
  53 + </executions>
  54 + </plugin>
  55 + <plugin>
18 <groupId>org.dstovall</groupId> 56 <groupId>org.dstovall</groupId>
19 <artifactId>onejar-maven-plugin</artifactId> 57 <artifactId>onejar-maven-plugin</artifactId>
20 <version>1.4.4</version> 58 <version>1.4.4</version>
@@ -58,6 +96,7 @@ @@ -58,6 +96,7 @@
58 <version>3.6.10</version> 96 <version>3.6.10</version>
59 </dependency> 97 </dependency>
60 </dependencies> 98 </dependencies>
  99 +
61 <repositories> 100 <repositories>
62 <repository> 101 <repository>
63 <id>zil-maven-repo</id> 102 <id>zil-maven-repo</id>
@@ -65,10 +104,22 @@ @@ -65,10 +104,22 @@
65 <url>http://maven.nlp.ipipan.waw.pl/content/repositories/snapshots</url> 104 <url>http://maven.nlp.ipipan.waw.pl/content/repositories/snapshots</url>
66 </repository> 105 </repository>
67 </repositories> 106 </repositories>
  107 +
68 <pluginRepositories> 108 <pluginRepositories>
69 <pluginRepository> 109 <pluginRepository>
70 <id>onejar-maven-plugin.googlecode.com</id> 110 <id>onejar-maven-plugin.googlecode.com</id>
71 <url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url> 111 <url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
72 </pluginRepository> 112 </pluginRepository>
73 </pluginRepositories> 113 </pluginRepositories>
  114 +
  115 + <distributionManagement>
  116 + <repository>
  117 + <id>deployment</id>
  118 + <url>http://maven.nlp.ipipan.waw.pl/content/repositories/releases/</url>
  119 + </repository>
  120 + <snapshotRepository>
  121 + <id>deployment</id>
  122 + <url>http://maven.nlp.ipipan.waw.pl/content/repositories/snapshots/</url>
  123 + </snapshotRepository>
  124 + </distributionManagement>
74 </project> 125 </project>
src/main/java/pl/waw/ipipan/zil/core/md/Main.java
@@ -42,7 +42,7 @@ public class Main { @@ -42,7 +42,7 @@ public class Main {
42 * Main method for detecting mentions in corpus encoded in Tei format. 42 * Main method for detecting mentions in corpus encoded in Tei format.
43 * 43 *
44 * @param args 44 * @param args
45 - * @throws TEIException 45 + * arguments
46 */ 46 */
47 public static void main(String[] args) { 47 public static void main(String[] args) {
48 48
@@ -103,10 +103,14 @@ public class Main { @@ -103,10 +103,14 @@ public class Main {
103 * similar directory structure in the output corpus directory. 103 * similar directory structure in the output corpus directory.
104 * 104 *
105 * @param inputCorpusDir 105 * @param inputCorpusDir
  106 + * input corpus directory
106 * @param outputCorpusDir 107 * @param outputCorpusDir
  108 + * output corpus directory
107 * @param textDir 109 * @param textDir
108 - * @return 110 + * input text dir
  111 + * @return target text dir
109 * @throws IOException 112 * @throws IOException
  113 + * when an error occurs
110 */ 114 */
111 private static File createTargetTextDir(File inputCorpusDir, File outputCorpusDir, File textDir) throws IOException { 115 private static File createTargetTextDir(File inputCorpusDir, File outputCorpusDir, File textDir) throws IOException {
112 String relativeDirPath = textDir.toString().substring(inputCorpusDir.toString().length()); 116 String relativeDirPath = textDir.toString().substring(inputCorpusDir.toString().length());
@@ -122,7 +126,9 @@ public class Main { @@ -122,7 +126,9 @@ public class Main {
122 * annotation. 126 * annotation.
123 * 127 *
124 * @param thriftText 128 * @param thriftText
  129 + * text to annotate with mentions
125 * @throws MultiserviceException 130 * @throws MultiserviceException
  131 + * when an error occures
126 */ 132 */
127 public static void annotateThriftText(TText thriftText) throws MultiserviceException { 133 public static void annotateThriftText(TText thriftText) throws MultiserviceException {
128 Text responseText = ThriftLoader.loadTextFromThrift(thriftText); 134 Text responseText = ThriftLoader.loadTextFromThrift(thriftText);
@@ -135,8 +141,9 @@ public class Main { @@ -135,8 +141,9 @@ public class Main {
135 * annotation. This method does not save this Tei text on disk. 141 * annotation. This method does not save this Tei text on disk.
136 * 142 *
137 * @param teiText 143 * @param teiText
138 - * @param zeroSubjectModel 144 + * text to annotate with mentions
139 * @throws TEIException 145 * @throws TEIException
  146 + * when an error occurs
140 */ 147 */
141 public static void annotateTeiText(TEICorpusText teiText) throws TEIException { 148 public static void annotateTeiText(TEICorpusText teiText) throws TEIException {
142 Text responseText = TeiLoader.loadTextFromTei(teiText); 149 Text responseText = TeiLoader.loadTextFromTei(teiText);
src/main/java/pl/waw/ipipan/zil/core/md/detection/zero/FeatureGeneration.java
@@ -54,9 +54,9 @@ public class FeatureGeneration { @@ -54,9 +54,9 @@ public class FeatureGeneration {
54 features.put("verbNumber", m.getChosenInterpretation().getNumber()); 54 features.put("verbNumber", m.getChosenInterpretation().getNumber());
55 features.put("verbGender", m.getChosenInterpretation().getGender()); 55 features.put("verbGender", m.getChosenInterpretation().getGender());
56 features.put("verbPerson", m.getChosenInterpretation().getPerson()); 56 features.put("verbPerson", m.getChosenInterpretation().getPerson());
57 - 57 +
58 features.put("quasi", quasiVerbs.contains(m.getChosenInterpretation().getBase())); 58 features.put("quasi", quasiVerbs.contains(m.getChosenInterpretation().getBase()));
59 - 59 +
60 features.put("nextCtag", getNeighbouringTag(s, m, 1)); 60 features.put("nextCtag", getNeighbouringTag(s, m, 1));
61 features.put("prevCtag", getNeighbouringTag(s, m, -1)); 61 features.put("prevCtag", getNeighbouringTag(s, m, -1));
62 62
@@ -217,6 +217,12 @@ public class FeatureGeneration { @@ -217,6 +217,12 @@ public class FeatureGeneration {
217 * - podział na klauzule: przecinki oraz spójniki bezprzecinkowe: i, albo, 217 * - podział na klauzule: przecinki oraz spójniki bezprzecinkowe: i, albo,
218 * lub (jak przy streszczeniach: w środku musi być czasownik w formie 218 * lub (jak przy streszczeniach: w środku musi być czasownik w formie
219 * osobowej), 219 * osobowej),
  220 + *
  221 + * @param s
  222 + * sentence
  223 + * @param m2
  224 + * token
  225 + * @return clause with the token
220 */ 226 */
221 public static List<Token> getClause(Sentence s, Token m2) { 227 public static List<Token> getClause(Sentence s, Token m2) {
222 228
@@ -310,7 +316,7 @@ public class FeatureGeneration { @@ -310,7 +316,7 @@ public class FeatureGeneration {
310 // other verbs have number:person 316 // other verbs have number:person
311 String keywordPerson = keyword.getPerson(); 317 String keywordPerson = keyword.getPerson();
312 String wordPerson = "ter"; // default 318 String wordPerson = "ter"; // default
313 - if (PRONOUN_TAGS.contains(candidate)) 319 + if (PRONOUN_TAGS.contains(candidate.getCtag()))
314 wordPerson = candidate.getPerson(); 320 wordPerson = candidate.getPerson();
315 return wordPerson.equals(keywordPerson); 321 return wordPerson.equals(keywordPerson);
316 } 322 }