Exemplo n.º 1
0
  void process(AnalyzeContext context, boolean useSmart) {
    QuickSortSet orgLexemes = context.getOrgLexemes();
    Lexeme orgLexeme = orgLexemes.pollFirst();

    LexemePath crossPath;
    Cell headCell;
    LexemePath judgeResult;
    for (crossPath = new LexemePath(); orgLexeme != null; orgLexeme = orgLexemes.pollFirst()) {
      if (!crossPath.addCrossLexeme(orgLexeme)) {
        if (crossPath.size() != 1 && useSmart) {
          headCell = crossPath.getHead();
          judgeResult = this.judge(headCell, crossPath.getPathLength());
          context.addLexemePath(judgeResult);
        } else {
          context.addLexemePath(crossPath);
        }

        crossPath = new LexemePath();
        crossPath.addCrossLexeme(orgLexeme);
      }
    }

    if (crossPath.size() != 1 && useSmart) {
      headCell = crossPath.getHead();
      judgeResult = this.judge(headCell, crossPath.getPathLength());
      context.addLexemePath(judgeResult);
    } else {
      context.addLexemePath(crossPath);
    }
  }