Package com.chenlb.mmseg4j.Dictionary

Examples of com.chenlb.mmseg4j.Dictionary.FileLoading


   */
  public static void main(String[] args) throws IOException {
    FileInputStream fis = new FileInputStream(new File("dic/word-with-attr.dic"));
    final Set<String> words = new TreeSet<String>();
    final int[] num = {0};
    FileLoading fl = new FileLoading() {

      public void row(String line, int n) {
        words.add(line.trim());
        num[0]++;
      }
View Full Code Here


  @Test
  public void testStandard() throws IOException {

    FileInputStream fis = new FileInputStream("src/test/resources/text-sentence.txt");
    Dictionary.load(fis, new FileLoading() {

      StandardAnalyzer sa = new StandardAnalyzer(Version.LUCENE_CURRENT);

      @Override
      public void row(String line, int n) {
View Full Code Here

  private void assertTokenizerFactory(final String fieldName, final Seg seg) throws IOException {
    logger.info("assert TokenizerFactory field type={}", fieldName);
    FileInputStream fis = new FileInputStream("src/test/resources/text-sentence.txt");
    try {
      Dictionary.load(fis, new FileLoading() {

        @Override
        public void row(String line, int n) {
          List<String> mwords = AnalyzerTest.toMMsegWords(line, seg);
View Full Code Here

TOP

Related Classes of com.chenlb.mmseg4j.Dictionary.FileLoading

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.