Package edu.stanford.nlp.trees.treebank

Examples of edu.stanford.nlp.trees.treebank.Mapper.map()


        // Tokenize with the mapper
        StringBuilder sb = new StringBuilder();
        String[] toks = line.split("\\s+");
        for (String tok : toks) {
          String mappedTok = lexMapper.map(null, tok);
          sb.append(mappedTok).append(" ");
        }
        List<String> mappedToks = Arrays.asList(sb.toString().trim().split("\\s+"));

        // Evaluate the output
View Full Code Here


    String test1 = "DET+NOUN+NSUFF_FEM_SG+CASE_DEF_ACC";
    String test2 = "ADJXXXXX";
    String test3 = "REL_ADV";
    String test4 = "NUMERIC_COMMA";

    System.out.printf("%s --> %s\n",test1,mapper.map(test1, null));
    System.out.printf("%s --> %s\n",test2,mapper.map(test2, null));
    System.out.printf("%s --> %s\n",test3,mapper.map(test3, null));
    System.out.printf("%s --> %s\n",test4,mapper.map(test4, null));
  }
View Full Code Here

    String test2 = "ADJXXXXX";
    String test3 = "REL_ADV";
    String test4 = "NUMERIC_COMMA";

    System.out.printf("%s --> %s\n",test1,mapper.map(test1, null));
    System.out.printf("%s --> %s\n",test2,mapper.map(test2, null));
    System.out.printf("%s --> %s\n",test3,mapper.map(test3, null));
    System.out.printf("%s --> %s\n",test4,mapper.map(test4, null));
  }

}
View Full Code Here

    String test3 = "REL_ADV";
    String test4 = "NUMERIC_COMMA";

    System.out.printf("%s --> %s\n",test1,mapper.map(test1, null));
    System.out.printf("%s --> %s\n",test2,mapper.map(test2, null));
    System.out.printf("%s --> %s\n",test3,mapper.map(test3, null));
    System.out.printf("%s --> %s\n",test4,mapper.map(test4, null));
  }

}
View Full Code Here

    String test4 = "NUMERIC_COMMA";

    System.out.printf("%s --> %s\n",test1,mapper.map(test1, null));
    System.out.printf("%s --> %s\n",test2,mapper.map(test2, null));
    System.out.printf("%s --> %s\n",test3,mapper.map(test3, null));
    System.out.printf("%s --> %s\n",test4,mapper.map(test4, null));
  }

}
View Full Code Here

  }

  public static void main(String[] args) {
    Mapper m = new DefaultLexicalMapper();

    System.out.printf("< :-> %s\n",m.map(null, "FNKqq"));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.