예제 #1
0
파일: Treebank.java 프로젝트: divoxx/porser
 /**
  * Returns <code>true</code> if <code>preterminal</code> represents a terminal with one of the
  * following parts of speech: <tt>VB, VBD, VBG, VBN, VBP</tt> or <tt>VBZ</tt>. It is an error to
  * call this method with a <code>Sexp</code> object for which {@link #isPreterminal(Sexp)} returns
  * <code>false</code>.<br>
  *
  * @param preterminal the preterminal to test
  * @return <code>true</code> if <code>preterminal</code> is a verb
  */
 public boolean isVerb(Sexp preterminal) {
   return isVerbTag(preterminal.list().get(0).symbol());
 }
예제 #2
0
파일: Treebank.java 프로젝트: divoxx/porser
 /**
  * Returns <code>true</code> if the specified S-expression represents a preterminal that is the
  * possessive part of speech. This method is intended to be used by implementations of {@link
  * Training#addBaseNPs(Sexp)}.
  */
 public boolean isPossessivePreterminal(Sexp tree) {
   return (isPreterminal(tree) && tree.list().get(0).symbol() == possessivePos);
 }
예제 #3
0
파일: Treebank.java 프로젝트: divoxx/porser
 /**
  * Returns <code>true</code> if the specified S-expression represents a preterminal whose terminal
  * element is the null element (<code>&quot;-NONE-&quot;</code>) for the Penn Treebank.
  *
  * @see Training#relabelSubjectlessSentences(Sexp)
  */
 public boolean isNullElementPreterminal(Sexp tree) {
   return (isPreterminal(tree) && tree.list().get(0).symbol() == nullElementPreterminal);
 }
예제 #4
0
파일: Treebank.java 프로젝트: divoxx/porser
 /**
  * Returns <code>true</code> if the specified S-expression is a preterminal whose part of speech
  * is <code>&quot;,&quot;</code> or <code>&quot;:&quot;</code>.
  */
 public boolean isPuncToRaise(Sexp preterm) {
   return (isPreterminal(preterm) && puncToRaise.contains(preterm.list().first()));
 }
예제 #5
0
파일: Treebank.java 프로젝트: divoxx/porser
 /**
  * Returns <code>true</code> if <code>tree</code> represents a preterminal subtree (part-of-speech
  * tag and word). Specifically, this method returns <code>true</code> if <code>tree</code> is an
  * instance of <code>SexpList</code>, has a length of 2 and has a first list element of type
  * <code>Symbol</code>.
  */
 public final boolean isPreterminal(Sexp tree) {
   return (tree.isList()
       && tree.list().length() == 2
       && tree.list().get(0).isSymbol()
       && tree.list().get(1).isSymbol());
 }