ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlig...@apache.org
Subject svn commit: r1696623 - in /ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes: consumers/SentencePrinter.java index/IndexSentences.java
Date Wed, 19 Aug 2015 16:18:52 GMT
Author: dligach
Date: Wed Aug 19 16:18:52 2015
New Revision: 1696623

URL: http://svn.apache.org/r1696623
Log:
actually need to replace line breaks with an empty space rather than remove them

Modified:
    ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/consumers/SentencePrinter.java
    ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/index/IndexSentences.java

Modified: ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/consumers/SentencePrinter.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/consumers/SentencePrinter.java?rev=1696623&r1=1696622&r2=1696623&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/consumers/SentencePrinter.java
(original)
+++ ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/consumers/SentencePrinter.java
Wed Aug 19 16:18:52 2015
@@ -69,7 +69,7 @@ public class SentencePrinter {
       
       for(Sentence sentence : JCasUtil.select(jCas, Sentence.class)) {
         String withLineBreaks = sentence.getCoveredText();
-        String noLineBreaks = withLineBreaks.replace("\n", "");
+        String noLineBreaks = withLineBreaks.replace("\n", " ");
         System.out.println(" * " + noLineBreaks);
         System.out.println();
       }

Modified: ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/index/IndexSentences.java
URL: http://svn.apache.org/viewvc/ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/index/IndexSentences.java?rev=1696623&r1=1696622&r2=1696623&view=diff
==============================================================================
--- ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/index/IndexSentences.java (original)
+++ ctakes/sandbox/ctakes-wsd/src/main/java/org/apache/ctakes/index/IndexSentences.java Wed
Aug 19 16:18:52 2015
@@ -107,7 +107,7 @@ public class IndexSentences {
       for(Sentence sentence : JCasUtil.select(jCas, Sentence.class)) {
         Document document = new Document();
         String withLineBreaks = sentence.getCoveredText();
-        String noLineBreaks = withLineBreaks.replace("\n", "");
+        String noLineBreaks = withLineBreaks.replace("\n", " ");
         document.add(new Field("content", noLineBreaks, Field.Store.YES, Field.Index.ANALYZED,
Field.TermVector.YES));
         try {
           indexWriter.addDocument(document);



Mime
View raw message