Package org.wltea.analyzer.dic

Examples of org.wltea.analyzer.dic.Hit


        }
      }     
     
      //*********************************
      //再对当前指针位置的字符进行单字匹配
      Hit singleCharHit = Dictionary.getSingleton().matchInMainDict(context.getSegmentBuff(), context.getCursor(), 1);
      if(singleCharHit.isMatch()){//首字成词
        //输出当前的词
        Lexeme newLexeme = new Lexeme(context.getBufferOffset() , context.getCursor() , 1 , Lexeme.TYPE_CNWORD);
        context.addLexeme(newLexeme);

        //同时也是词前缀
        if(singleCharHit.isPrefix()){
          //前缀匹配则放入hit列表
          this.tmpHits.add(singleCharHit);
        }
      }else if(singleCharHit.isPrefix()){//首字为词前缀
        //前缀匹配则放入hit列表
        this.tmpHits.add(singleCharHit);
      }
     

View Full Code Here


        }
      }       

      //*********************************
      //对当前指针位置的字符进行单字匹配
      Hit singleCharHit = Dictionary.getSingleton().matchInQuantifierDict(context.getSegmentBuff(), context.getCursor(), 1);
      if(singleCharHit.isMatch()){//首字成量词词
        //输出当前的词
        Lexeme newLexeme = new Lexeme(context.getBufferOffset() , context.getCursor() , 1 , Lexeme.TYPE_COUNT);
        context.addLexeme(newLexeme);

        //同时也是词前缀
        if(singleCharHit.isPrefix()){
          //前缀匹配则放入hit列表
          this.countHits.add(singleCharHit);
        }
      }else if(singleCharHit.isPrefix()){//首字为量词前缀
        //前缀匹配则放入hit列表
        this.countHits.add(singleCharHit);
      }
     
     
View Full Code Here

TOP

Related Classes of org.wltea.analyzer.dic.Hit

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.