houbb / pinyin

The high performance pinyin tool for java.(java 高性能中文转拼音工具。支持同音字。)
https://houbb.github.io/opensource/pinyin
Apache License 2.0
241 stars 34 forks source link

maven直接打包生成jar文件,执行时PinyinToneReverse会报错 #19

Open hnjerryluo opened 2 years ago

hnjerryluo commented 2 years ago

猜测是否为生成JAR包后读取不到/pinyin_dict_char.txt文件,后改为lib分离打包的形式后解决 Exception in thread "mainTimerThread" java.lang.ExceptionInInitializerError at com.github.houbb.pinyin.bs.PinyinBs.(PinyinBs.java:76) at com.github.houbb.pinyin.bs.PinyinBs.newInstance(PinyinBs.java:90) at com.github.houbb.pinyin.util.PinyinHelper.(PinyinHelper.java:32) at com.txht.service.ForecastService.getWeather(ForecastService.java:85) at com.txht.service.ForecastService.doGrab(ForecastService.java:61) at com.txht.task.MyTimerTask$workTimerTask.run(MyTimerTask.java:32) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at com.github.houbb.pinyin.support.tone.PinyinToneReverse.(PinyinToneReverse.java:52) ... 8 more