File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
mathosphere-core/src/main/java/com/formulasearchengine/mathosphere/mlp/text Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1313
1414public class UnicodeMap {
1515
16- private static final Map <Integer , String > MAP = buildMap () ;
16+ private static Map <Integer , String > MAP = null ;
1717
18- private static Map < Integer , String > buildMap () {
18+ private static void buildMap () {
1919 // see table here
2020 // http://unicode-table.com/en/blocks/letterlike-symbols/
2121
@@ -32,7 +32,7 @@ private static Map<Integer, String> buildMap() {
3232 LOGGER .error ("unicode2tex-problem" );
3333 e .printStackTrace ();
3434 }
35- return unicode2tex .build ();
35+ MAP = unicode2tex .build ();
3636 }
3737
3838 private static final Logger LOGGER = LoggerFactory .getLogger (UnicodeMap .class );
@@ -54,6 +54,9 @@ public static String string2TeX(String in) {
5454 }
5555
5656 public static String char2TeX (int codePoint ) {
57+ if ( MAP == null ){
58+ buildMap ();
59+ }
5760 if (CharUtils .isAsciiPrintable ((char ) codePoint )) {
5861 return CharUtils .toString ((char ) codePoint );
5962 }
You can’t perform that action at this time.
0 commit comments