You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by bg...@apache.org on 2012/01/18 21:36:42 UTC
svn commit: r1233052 -
/incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java
Author: bgalitsky
Date: Wed Jan 18 20:36:42 2012
New Revision: 1233052
URL: http://svn.apache.org/viewvc?rev=1233052&view=rev
Log:
repaired appropriateness criterion for sentence inclusion into generated content
Modified:
incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java
Modified: incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java
URL: http://svn.apache.org/viewvc/incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java?rev=1233052&r1=1233051&r2=1233052&view=diff
==============================================================================
--- incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java (original)
+++ incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java Wed Jan 18 20:36:42 2012
@@ -18,11 +18,13 @@
package opennlp.tools.textsimilarity;
import java.util.List;
+import java.util.logging.Logger;
import org.apache.commons.lang.StringUtils;
public class SentencePairMatchResult {
public List<List<ParseTreeChunk>> matchResult;
+ private static Logger LOG = Logger.getLogger("opennlp.tools.textsimilarity.SentencePairMatchResult");
public List<List<ParseTreeChunk>> getMatchResult() {
return matchResult;
@@ -67,7 +69,7 @@ public class SentencePairMatchResult {
super();
verbExists = false;
imperativeVerb = false;
- System.out.println("Assessing sentence for inclusion " + resForMinedSent1);
+ //LOG.info("Assessing sentence for inclusion " + resForMinedSent1);
this.matchResult = matchResult;
this.resForMinedSent1 = resForMinedSent1;
for (LemmaPair word : resForMinedSent1) {
@@ -75,18 +77,19 @@ public class SentencePairMatchResult {
&& StringUtils.isAlpha(word.getLemma())) {// ||
// word.getPOS().startsWith("VP"))
verbExists = true;
- System.out.println("Found verb=" + word);
+ //LOG.info("Found verb=" + word);
}
}
// various form of sales pitch: 'get something', or 'we offer'
- if (resForMinedSent1.get(1).getLemma().startsWith("We")
- || resForMinedSent1.get(2).getLemma().startsWith("We"))
+ if (resForMinedSent1.size()>2 && (resForMinedSent1.get(1).getLemma().startsWith("We")
+ || resForMinedSent1.get(2).getLemma().startsWith("We")))
imperativeVerb = true;
+
for (LemmaPair word : resForMinedSent1) {
if (word.getPOS().startsWith("VB") && word.getStartPos() < 1
&& word.getEndPos() < 1) {
imperativeVerb = true;
- System.out.println("Found imperative verb=" + word);
+ //LOG.info("Found imperative verb=" + word);
}
}
Re: svn commit: r1233052 - /incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java
Posted by Jörn Kottmann <ko...@gmail.com>.
Please always mention the jira issue key in the commit
message, like you did in your second commit.
Jörn
On 1/18/12 9:36 PM, bgalitsky@apache.org wrote:
> Author: bgalitsky
> Date: Wed Jan 18 20:36:42 2012
> New Revision: 1233052
>
> URL: http://svn.apache.org/viewvc?rev=1233052&view=rev
> Log:
> repaired appropriateness criterion for sentence inclusion into generated content
>
> Modified:
> incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java
>
> Modified: incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java
> URL: http://svn.apache.org/viewvc/incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java?rev=1233052&r1=1233051&r2=1233052&view=diff
> ==============================================================================
> --- incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java (original)
> +++ incubator/opennlp/sandbox/opennlp-similarity/src/main/java/opennlp/tools/textsimilarity/SentencePairMatchResult.java Wed Jan 18 20:36:42 2012
> @@ -18,11 +18,13 @@
> package opennlp.tools.textsimilarity;
>
> import java.util.List;
> +import java.util.logging.Logger;
>
> import org.apache.commons.lang.StringUtils;
>
> public class SentencePairMatchResult {
> public List<List<ParseTreeChunk>> matchResult;
> + private static Logger LOG = Logger.getLogger("opennlp.tools.textsimilarity.SentencePairMatchResult");
>
> public List<List<ParseTreeChunk>> getMatchResult() {
> return matchResult;
> @@ -67,7 +69,7 @@ public class SentencePairMatchResult {
> super();
> verbExists = false;
> imperativeVerb = false;
> - System.out.println("Assessing sentence for inclusion " + resForMinedSent1);
> + //LOG.info("Assessing sentence for inclusion " + resForMinedSent1);
> this.matchResult = matchResult;
> this.resForMinedSent1 = resForMinedSent1;
> for (LemmaPair word : resForMinedSent1) {
> @@ -75,18 +77,19 @@ public class SentencePairMatchResult {
> && StringUtils.isAlpha(word.getLemma())) {// ||
> // word.getPOS().startsWith("VP"))
> verbExists = true;
> - System.out.println("Found verb=" + word);
> + //LOG.info("Found verb=" + word);
> }
> }
> // various form of sales pitch: 'get something', or 'we offer'
> - if (resForMinedSent1.get(1).getLemma().startsWith("We")
> - || resForMinedSent1.get(2).getLemma().startsWith("We"))
> + if (resForMinedSent1.size()>2&& (resForMinedSent1.get(1).getLemma().startsWith("We")
> + || resForMinedSent1.get(2).getLemma().startsWith("We")))
> imperativeVerb = true;
> +
> for (LemmaPair word : resForMinedSent1) {
> if (word.getPOS().startsWith("VB")&& word.getStartPos()< 1
> && word.getEndPos()< 1) {
> imperativeVerb = true;
> - System.out.println("Found imperative verb=" + word);
> + //LOG.info("Found imperative verb=" + word);
> }
> }
>
>
>