com.hankcs.hanlp.dictionary.py
类 PinyinUtil

java.lang.Object
  继承者 com.hankcs.hanlp.dictionary.py.PinyinUtil

public class PinyinUtil
extends Object

作者:
hankcs

构造方法摘要
PinyinUtil()
           
 
方法摘要
static Pinyin[] convertList2Array(List<Pinyin> pinyinList)
          将列表转为数组
static List<String> convertPinyinList2TonePinyinList(List<Pinyin> pinyinList)
          转换List pinyinList到List,其中的String为带声调符号形式
static String convertToneNumber2ToneMark(String pinyinStr)
          Convert tone numbers to tone marks using Unicode

Algorithm for determining location of tone mark

A simple algorithm for determining the vowel on which the tone mark appears is as follows:

First, look for an "a" or an "e".

static Pinyin removeTone(Pinyin p)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

PinyinUtil

public PinyinUtil()
方法详细信息

convertToneNumber2ToneMark

public static String convertToneNumber2ToneMark(String pinyinStr)
Convert tone numbers to tone marks using Unicode

Algorithm for determining location of tone mark

A simple algorithm for determining the vowel on which the tone mark appears is as follows:

  1. First, look for an "a" or an "e". If either vowel appears, it takes the tone mark. There are no possible pinyin syllables that contain both an "a" and an "e".

  2. If there is no "a" or "e", look for an "ou". If "ou" appears, then the "o" takes the tone mark.

  3. If none of the above cases hold, then the last vowel in the syllable takes the tone mark.

参数:
pinyinStr - the ascii represention with tone numbers
返回:
the unicode represention with tone marks

convertList2Array

public static Pinyin[] convertList2Array(List<Pinyin> pinyinList)
将列表转为数组

参数:
pinyinList -
返回:

removeTone

public static Pinyin removeTone(Pinyin p)

convertPinyinList2TonePinyinList

public static List<String> convertPinyinList2TonePinyinList(List<Pinyin> pinyinList)
转换List pinyinList到List,其中的String为带声调符号形式

参数:
pinyinList -
返回:


Copyright © 2014–2015 码农场. All rights reserved.