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

com.taotao.boot.pinyin.spi.IPinyinTone Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2020-2030, Shuigedeng ([email protected] & https://blog.taotaocloud.top/).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.taotao.boot.pinyin.spi;

import com.taotao.boot.pinyin.api.IPinyinContext;

import java.util.List;
import java.util.Set;

/**
 * 拼音连接接口
 *
 * 

(1)可以使用模式来制定对应的映射实现。 */ public interface IPinyinTone { /** * 获取映射后的信息 * * @param segment 分词后的片段 * @param context 上下文 * @return 结果 */ String tone(final String segment, final IPinyinContext context); /** * 返回所有的列表 * * @param chinese 单个中文 * @param context 上下文 * @return 结果 */ List toneList(final String chinese, final IPinyinContext context); /** * 词组列表 * *

作用:快速分词。 * * @return 列表 */ Set phraseSet(); /** * 根据中文获取对应的拼音声调 * *

1. 这里暂时没有考虑多音字的问题。 2. 如果考虑内容不是单个字,那么结果应该变为一个列表。 * * @param defaultPinyin 中文拼音-默认格式 * @return 声调 */ int toneNum(final String defaultPinyin); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy