code: protected void segment(final String sentence, final String normalized, final List<String> wordList, final List<CoreDictionary.Attribute> attributeList)
      {
          if (attributeList != null)
          {
              final int[] offset = new int[]{0};
              CustomDictionary.parseLongestText(sentence, new AhoCorasickDoubleArrayTrie.IHit<CoreDictionary.Attribute>()
              {
                  @Override
                  public void hit(int begin, int end, CoreDictionary.Attribute value)
                  {
                      if (begin != offset[0])
                      {
                          segmentAfterRule(sentence.substring(offset[0], begin), normalized.substring(offset[0], begin), wordList);
                      }
                      while (attributeList.size() < wordList.size())
                          attributeList.add(null);
                      wordList.add(sentence.substring(begin, end));
                      attributeList.add(value);
                      assert wordList.size() == attributeList.size() : "词语列表与属性列表不等长";
                      offset[0] = end;
                  }
              });
              if (offset[0] != sentence.length())
              {
                  segmentAfterRule(sentence.substring(offset[0]), normalized.substring(offset[0]), wordList);
              }
          }
          else
          {
              segmentAfterRule(sentence, normalized, wordList);
          }
      }
docs: 分词
  
  @param sentence      文本
  @param normalized    正规化后的文本
  @param wordList      储存单词列表
  @param attributeList 储存用户词典中的词性，设为null表示不查询用户词典