Package com.knowledgebooks.nlp.fasttag

Examples of com.knowledgebooks.nlp.fasttag.FastTag


  public static List<String> youTag(String content) {
    List<String> result = new ArrayList<String>();
    try {
      TreeMap<String, String> treeTag = new TreeMap<String, String>();
      String[] words = Tokenizer.wordsToArray(content);
      String[] tags = (new FastTag()).tag(words);
      for (int i = 0; i < words.length; i++) {
        if (tags[i].equals("NN") || tags[i].equals("NNS")
            || tags[i].equals("NNP") || tags[i].equals("NNPS")) {
          if (words[i].length() > 2) {
            treeTag.put(words[i], words[i]);
View Full Code Here


      throw new EventGenerationException("DefinitionsEventDriver failed to open WordNet");
    }

    String current = new String(text);

    FastTag tagger = new FastTag();

    List<String> words = Lists.newArrayList(Splitter.on(CharMatcher.WHITESPACE).trimResults().omitEmptyStrings()
        .split(current));

    List<String> tagged = tagger.tag(words);
    IIndexWord idxWord;
    List<IWordID> wordID;
    IWord word;
    StringBuilder outDef = new StringBuilder();
View Full Code Here

  private static PunctuationSeparator punctuationSeparator = new PunctuationSeparator();
 
  @Override
  public EventSet createEventSet(char[] text) {

    FastTag tagger = new FastTag();
   
    EventSet es = new EventSet();

    text = punctuationSeparator.process(text);

    String stringText = new String(text);

    for (String current : stringText.split("(?<=[?!\\.])\\s+")) {

      String[] tmpArray = current.split("\\s");

      List<String> tmp = Arrays.asList(tmpArray);

      List<String> tagged = tagger.tag(tmp);

      for (int j = 0; j < tagged.size(); j++) {
        es.addEvent(new Event(tagged.get(j), this));
      }
    }
View Full Code Here

TOP

Related Classes of com.knowledgebooks.nlp.fasttag.FastTag

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.