import java.util.HashMap; import java.util.Map; /** * a class to deal with Chinese numeric.
* * @author chenxin {@link http://www.webssky.com} */ public class CNNMFilter { /** * chinese numeric chars.
* i have put the chars into the lexicon file lex-cn-numeric.lex for the old * version. it's better to follow the current work. */ private static final Character[] CN_NUMERIC = { '一', '二', '三', '四', '五', '六', '七', '八', '九', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '十', '百', '千', '拾', '佰', '仟', '万', '亿', '○', 'O', '零' }; private static Map cnNumeric = null; static { cnNumeric = new HashMap(40, 0.85f); for (int j = 0; j < 9; j++) cnNumeric.put(CN_NUMERIC[j], j + 1);
java中文转换数字_java中文数字转换成阿拉伯数字
最新推荐文章于 2021-03-05 01:59:01 发布