Skip to content

Commit

Permalink
update Segment
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangnanboy committed Dec 14, 2022
1 parent 9dcb98c commit b7f6512
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/main/java/sy/util/Segment.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package sy.util;

import com.github.houbb.segment.api.ISegmentResult;
import com.github.houbb.segment.bs.SegmentBs;
import com.github.houbb.segment.support.tagging.pos.tag.impl.SegmentPosTaggings;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.seg.common.Term;

Expand All @@ -19,16 +15,6 @@
*/
public class Segment {

public static List<Entry> jiebaSegment(String text) {
List<Entry> entryList = CollectionUtil.newArrayList();
List<ISegmentResult> resultList = SegmentBs.newInstance()
.posTagging(SegmentPosTaggings.simple())
.segment(text);
resultList.forEach(result -> entryList.add(new Entry(result.word(), result.pos())));

return entryList;
}

public static List<Entry> hanlpSegment(String text, boolean posi) {
List<Entry> entryList = CollectionUtil.newArrayList();
com.hankcs.hanlp.seg.Segment seg = HanLP.newSegment();
Expand Down

0 comments on commit b7f6512

Please sign in to comment.