edu.stanford.nlp.util.StringUtils



API Populatity

1 Client projects

Project: edu.stanford

Package: edu.stanford.nlp

Project stanfordnlp/CoreNLP in file ...stanford.nlp.process.DocumentPreprocessorTest.java (2014-09-08)
@@ -16,6 +16,7 @@ import java.util.NoSuchElementException;
 
 import edu.stanford.nlp.ling.HasWord;
 import edu.stanford.nlp.ling.Sentence;
+import edu.stanford.nlp.util.StringUtils;
 
 
 public class DocumentPreprocessorTest extends TestCase {
@@ -39,7 +40,7 @@ public class DocumentPreprocessorTest extends TestCase {
       assertEquals(expectedResults[i], results.get(i));
     }
   }
-
+  
   public void testSetSentencePunctWords(){
     String test = "This is a test of the preprocessor2... it should split this text into sentences? This should be a different sentence.This should be attached to the previous sentence, though.";
     String []expectedResults = {"This is a test of the preprocessor2 ...",
@@ -49,14 +50,14 @@ public class DocumentPreprocessorTest extends TestCase {
       new DocumentPreprocessor(new BufferedReader(new StringReader(test)));
     String[] sentenceFinalPuncWords = {".", "?","!","...","\n"};
     document.setSentenceFinalPuncWords(sentenceFinalPuncWords);
-    for (List<HasWord> sentence : document) {
+    for (List<HasWord> sentence : document) {  
       results.add(Sentence.listToString(sentence));
     }
     assertEquals(expectedResults.length, results.size());
     for (int i = 0; i < results.size(); ++i) {
       assertEquals(expectedResults[i], results.get(i));
     }
-
+    
   }
 
   public static void compareXMLResults(String input,
Project stanfordnlp/CoreNLP in file ...stanford.nlp.process.DocumentPreprocessorTest.java (2014-08-17)
@@ -16,6 +16,7 @@ import java.util.NoSuchElementException;
 
 import edu.stanford.nlp.ling.HasWord;
 import edu.stanford.nlp.ling.Sentence;
+import edu.stanford.nlp.util.StringUtils;
 
 
 public class DocumentPreprocessorTest extends TestCase {
@@ -39,7 +40,7 @@ public class DocumentPreprocessorTest extends TestCase {
       assertEquals(expectedResults[i], results.get(i));
     }
   }
-
+  
   public void testSetSentencePunctWords(){
     String test = "This is a test of the preprocessor2... it should split this text into sentences? This should be a different sentence.This should be attached to the previous sentence, though.";
     String []expectedResults = {"This is a test of the preprocessor2 ...",
@@ -49,14 +50,14 @@ public class DocumentPreprocessorTest extends TestCase {
       new DocumentPreprocessor(new BufferedReader(new StringReader(test)));
     String[] sentenceFinalPuncWords = {".", "?","!","...","\n"};
     document.setSentenceFinalPuncWords(sentenceFinalPuncWords);
-    for (List<HasWord> sentence : document) {
+    for (List<HasWord> sentence : document) {  
       results.add(Sentence.listToString(sentence));
     }
     assertEquals(expectedResults.length, results.size());
     for (int i = 0; i < results.size(); ++i) {
       assertEquals(expectedResults[i], results.get(i));
     }
-
+    
   }
 
   public static void compareXMLResults(String input,
Project stanfordnlp/CoreNLP in file ...tanford.nlp.trees.EnglishGrammaticalRelations.java (2014-07-25)
@@ -30,6 +30,7 @@ import edu.stanford.nlp.trees.GrammaticalRelation.GrammaticalRelationAnnotation;
 import edu.stanford.nlp.trees.GrammaticalRelation.Language;
 import edu.stanford.nlp.trees.tregex.TregexPatternCompiler;
 import edu.stanford.nlp.util.Generics;
+import edu.stanford.nlp.util.StringUtils;
 
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
@@ -116,7 +117,7 @@ public class EnglishGrammaticalRelations {
   // TODO: remove everything but "to be".  Must do this carefully to
   // make sure we like all the dependency changes that happen
   static final String copularWordRegex =
-    "/^(?i:am|is|are|r|be|being|'s|'re|'m|was|were|been|s|ai|m|art|ar|wase|seem|seems|seemed|seeming|appear|appears|appeared|stay|stays|stayed|remain|remains|remained|resemble|resembles|resembled|resembling|become|becomes|became|becoming)$/";
+    "/^(?i:" + StringUtils.join(SemanticHeadFinder.copulaVerbs, "|") + ")$/";
   static final String clausalComplementRegex =
     "/^(?i:seem|seems|seemed|seeming|resemble|resembles|resembled|resembling|become|becomes|became|becoming)$/";
   private static final String passiveAuxWordRegex =