All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.houbb.sentence.segment.util.SentenceSegmentHelper Maven / Gradle / Ivy

package com.github.houbb.sentence.segment.util;

import com.github.houbb.sentence.segment.bs.SentenceSegmentBs;
import com.github.houbb.sentence.segment.support.result.ISentenceSegmentResultHandler;
import com.github.houbb.sentence.segment.support.result.impl.SentenceSegmentResultHandlers;

import java.util.List;

/**
 * 断句工具类
 * @author binbin.hou
 * @since 0.0.1
 */
public final class SentenceSegmentHelper {

    private SentenceSegmentHelper(){}

    /**
     * 断句处理
     * @param text 文本
     * @return 结果
     * @since 0.0.1
     */
    public static List segment(final String text) {
        return segment(text, SentenceSegmentResultHandlers.sentence());
    }

    /**
     * 断句处理
     * @param text 文本
     * @param handler 处理类
     * @param  泛型
     * @return 结果
     * @since 0.0.1
     */
    public static  R segment(final String text,
                                final ISentenceSegmentResultHandler handler) {
        return SentenceSegmentBs.newInstance().segment(text, handler);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy