Package edu.stanford.nlp.sempre.LanguageInfo

Examples of edu.stanford.nlp.sempre.LanguageInfo.WordInfo


        String[] posAndVarName = rhsToken.split("_");
        mapping[i]=varNameToPositionMap[Integer.parseInt(posAndVarName[1])];
      }
      else {
        String[] wordInfoParts = rhsToken.split("\\|\\|");
        rhs[i]=new WordInfo(wordInfoParts[0], wordInfoParts[0], wordInfoParts[1], wordInfoParts[2], "O");
      }
    }
    return new SubstitutableSyntacticRule(lhs, rhs, mapping, count);
  }
View Full Code Here


  public static void main(String[] args) {
    opts.verbose=3;
    SyntacticRuleSet.opts.rulesetPath="/Users/jonathanberant/Research/temp/syntactic-rules.retagged.sorted.txt";
    SyntacticRuleSet srt = new SyntacticRuleSet();
    LanguageInfo antecedent = new LanguageInfo();
    antecedent.addWordInfo(new WordInfo("where", "where", "WDT", "O", "O"));
    antecedent.addWordInfo(new WordInfo("was", "be", "VBD", "O", "O"));
    antecedent.addWordInfo(new WordInfo("obama", "obama", "NNP", "PERSON", "O"));
    antecedent.addWordInfo(new WordInfo("birth", "birth", "NN", "O", "O"));
    antecedent.addWordInfo(new WordInfo("place", "place", "NN", "O", "O"));

    LanguageInfo target = new LanguageInfo();
    target.addWordInfo(new WordInfo("where", "where", "WDT", "O", "O"));
    target.addWordInfo(new WordInfo("was", "be", "VBD", "O", "O"));
    target.addWordInfo(new WordInfo("obama", "obama", "NNP", "PERSON", "O"));
    target.addWordInfo(new WordInfo("'s", "'s", "POS", "O", "O"));
    target.addWordInfo(new WordInfo("place", "place", "NN", "O", "O"));
    target.addWordInfo(new WordInfo("of", "of", "IN", "O", "O"));
    target.addWordInfo(new WordInfo("birth", "birth", "NN", "O", "O"));
    srt.apply(antecedent, target);
  }
View Full Code Here

    try {
      return Integer.parseInt(value);
    }
    catch(NumberFormatException e) {
      String[] tokens = value.split(";;"); //HACK to get word info
      return new WordInfo(tokens[0], tokens[1], tokens[2], tokens[3], tokens[4]);
    }
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.sempre.LanguageInfo.WordInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.