@Test public void testParserString() { fail("Not yet implemented"); }
public List<String> parserString(String inputString) { List<String> outputList= new LinkedList<>(); int inputStringLength= inputString.length(); int forestDepth= StableData.INT_ZERO; int countInputStringLength; StringBuilder[] fixWords= new StringBuilder[StableData.INT_TWO]; fixWords[StableData.INT_ZERO]= new StringBuilder(); fixWords[StableData.INT_ONE]= new StringBuilder(); StringBuilder stringBuilder= new StringBuilder(); int find= StableData.INT_ZERO; Here: for (int charPosition= StableData.INT_ZERO; charPosition< inputStringLength; charPosition += (countInputStringLength!= StableData.INT_ZERO? countInputStringLength: StableData.INT_ONE)) { if(StableData.INT_ONE_TWO_EIGHT> inputString.charAt(charPosition)){ if(fixWords[StableData.INT_ZERO].length()> StableData.INT_ZERO) { if(fixWords[StableData.INT_ZERO].charAt(fixWords[StableData.INT_ZERO].length()- StableData.INT_ONE) < StableData.INT_ONE_TWO_EIGHT) { fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; find= StableData.INT_ONE; continue Here; } fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); } find= StableData.INT_ONE; fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; continue Here; } if(find== StableData.INT_ONE) { find= StableData.INT_ZERO; outputList.add(fixWords[StableData.INT_ZERO].toString()); } stringBuilder.delete(StableData.INT_ZERO, stringBuilder.length()); stringBuilder= neroController.getBinaryForestRecurWordOneTime(stringBuilder.append(inputString .charAt(charPosition)), inputString, charPosition, inputStringLength, forestRoots, forestDepth , charPosition+ StableData.INT_ONE); String countWordNode= stringBuilder.toString(); int compare= countInputStringLength= countWordNode.length(); if (compare== StableData.INT_ONE) { outputList.add(countWordNode); fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); fixWords[StableData.INT_ZERO].append(countWordNode); continue Here; } if (compare== StableData.INT_TWO) { countInputStringLength= nlpController.doSlangPartAndPOSCheckForTwoChar(countInputStringLength, outputList , stringBuilder, wordsForest, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_THREE) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doPOSAndEMMCheckOfThree(countInputStringLength, outputList , wordsForest, stringBuilder, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_FOUR) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doSlangCheck(countInputStringLength, outputList, stringBuilder , wordsForest, fixWords, posController, charPosition, inputString); } } return outputList; }
AnalyzerImp implements Analyzer { public List<String> parserString(String inputString) { List<String> outputList= new LinkedList<>(); int inputStringLength= inputString.length(); int forestDepth= StableData.INT_ZERO; int countInputStringLength; StringBuilder[] fixWords= new StringBuilder[StableData.INT_TWO]; fixWords[StableData.INT_ZERO]= new StringBuilder(); fixWords[StableData.INT_ONE]= new StringBuilder(); StringBuilder stringBuilder= new StringBuilder(); int find= StableData.INT_ZERO; Here: for (int charPosition= StableData.INT_ZERO; charPosition< inputStringLength; charPosition += (countInputStringLength!= StableData.INT_ZERO? countInputStringLength: StableData.INT_ONE)) { if(StableData.INT_ONE_TWO_EIGHT> inputString.charAt(charPosition)){ if(fixWords[StableData.INT_ZERO].length()> StableData.INT_ZERO) { if(fixWords[StableData.INT_ZERO].charAt(fixWords[StableData.INT_ZERO].length()- StableData.INT_ONE) < StableData.INT_ONE_TWO_EIGHT) { fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; find= StableData.INT_ONE; continue Here; } fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); } find= StableData.INT_ONE; fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; continue Here; } if(find== StableData.INT_ONE) { find= StableData.INT_ZERO; outputList.add(fixWords[StableData.INT_ZERO].toString()); } stringBuilder.delete(StableData.INT_ZERO, stringBuilder.length()); stringBuilder= neroController.getBinaryForestRecurWordOneTime(stringBuilder.append(inputString .charAt(charPosition)), inputString, charPosition, inputStringLength, forestRoots, forestDepth , charPosition+ StableData.INT_ONE); String countWordNode= stringBuilder.toString(); int compare= countInputStringLength= countWordNode.length(); if (compare== StableData.INT_ONE) { outputList.add(countWordNode); fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); fixWords[StableData.INT_ZERO].append(countWordNode); continue Here; } if (compare== StableData.INT_TWO) { countInputStringLength= nlpController.doSlangPartAndPOSCheckForTwoChar(countInputStringLength, outputList , stringBuilder, wordsForest, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_THREE) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doPOSAndEMMCheckOfThree(countInputStringLength, outputList , wordsForest, stringBuilder, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_FOUR) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doSlangCheck(countInputStringLength, outputList, stringBuilder , wordsForest, fixWords, posController, charPosition, inputString); } } return outputList; } }
AnalyzerImp implements Analyzer { public List<String> parserString(String inputString) { List<String> outputList= new LinkedList<>(); int inputStringLength= inputString.length(); int forestDepth= StableData.INT_ZERO; int countInputStringLength; StringBuilder[] fixWords= new StringBuilder[StableData.INT_TWO]; fixWords[StableData.INT_ZERO]= new StringBuilder(); fixWords[StableData.INT_ONE]= new StringBuilder(); StringBuilder stringBuilder= new StringBuilder(); int find= StableData.INT_ZERO; Here: for (int charPosition= StableData.INT_ZERO; charPosition< inputStringLength; charPosition += (countInputStringLength!= StableData.INT_ZERO? countInputStringLength: StableData.INT_ONE)) { if(StableData.INT_ONE_TWO_EIGHT> inputString.charAt(charPosition)){ if(fixWords[StableData.INT_ZERO].length()> StableData.INT_ZERO) { if(fixWords[StableData.INT_ZERO].charAt(fixWords[StableData.INT_ZERO].length()- StableData.INT_ONE) < StableData.INT_ONE_TWO_EIGHT) { fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; find= StableData.INT_ONE; continue Here; } fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); } find= StableData.INT_ONE; fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; continue Here; } if(find== StableData.INT_ONE) { find= StableData.INT_ZERO; outputList.add(fixWords[StableData.INT_ZERO].toString()); } stringBuilder.delete(StableData.INT_ZERO, stringBuilder.length()); stringBuilder= neroController.getBinaryForestRecurWordOneTime(stringBuilder.append(inputString .charAt(charPosition)), inputString, charPosition, inputStringLength, forestRoots, forestDepth , charPosition+ StableData.INT_ONE); String countWordNode= stringBuilder.toString(); int compare= countInputStringLength= countWordNode.length(); if (compare== StableData.INT_ONE) { outputList.add(countWordNode); fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); fixWords[StableData.INT_ZERO].append(countWordNode); continue Here; } if (compare== StableData.INT_TWO) { countInputStringLength= nlpController.doSlangPartAndPOSCheckForTwoChar(countInputStringLength, outputList , stringBuilder, wordsForest, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_THREE) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doPOSAndEMMCheckOfThree(countInputStringLength, outputList , wordsForest, stringBuilder, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_FOUR) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doSlangCheck(countInputStringLength, outputList, stringBuilder , wordsForest, fixWords, posController, charPosition, inputString); } } return outputList; }  }
AnalyzerImp implements Analyzer { public List<String> parserString(String inputString) { List<String> outputList= new LinkedList<>(); int inputStringLength= inputString.length(); int forestDepth= StableData.INT_ZERO; int countInputStringLength; StringBuilder[] fixWords= new StringBuilder[StableData.INT_TWO]; fixWords[StableData.INT_ZERO]= new StringBuilder(); fixWords[StableData.INT_ONE]= new StringBuilder(); StringBuilder stringBuilder= new StringBuilder(); int find= StableData.INT_ZERO; Here: for (int charPosition= StableData.INT_ZERO; charPosition< inputStringLength; charPosition += (countInputStringLength!= StableData.INT_ZERO? countInputStringLength: StableData.INT_ONE)) { if(StableData.INT_ONE_TWO_EIGHT> inputString.charAt(charPosition)){ if(fixWords[StableData.INT_ZERO].length()> StableData.INT_ZERO) { if(fixWords[StableData.INT_ZERO].charAt(fixWords[StableData.INT_ZERO].length()- StableData.INT_ONE) < StableData.INT_ONE_TWO_EIGHT) { fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; find= StableData.INT_ONE; continue Here; } fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); } find= StableData.INT_ONE; fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; continue Here; } if(find== StableData.INT_ONE) { find= StableData.INT_ZERO; outputList.add(fixWords[StableData.INT_ZERO].toString()); } stringBuilder.delete(StableData.INT_ZERO, stringBuilder.length()); stringBuilder= neroController.getBinaryForestRecurWordOneTime(stringBuilder.append(inputString .charAt(charPosition)), inputString, charPosition, inputStringLength, forestRoots, forestDepth , charPosition+ StableData.INT_ONE); String countWordNode= stringBuilder.toString(); int compare= countInputStringLength= countWordNode.length(); if (compare== StableData.INT_ONE) { outputList.add(countWordNode); fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); fixWords[StableData.INT_ZERO].append(countWordNode); continue Here; } if (compare== StableData.INT_TWO) { countInputStringLength= nlpController.doSlangPartAndPOSCheckForTwoChar(countInputStringLength, outputList , stringBuilder, wordsForest, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_THREE) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doPOSAndEMMCheckOfThree(countInputStringLength, outputList , wordsForest, stringBuilder, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_FOUR) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doSlangCheck(countInputStringLength, outputList, stringBuilder , wordsForest, fixWords, posController, charPosition, inputString); } } return outputList; }  void init(); void initMixed(); List<String> parserMixedString(String mixedString); List<String> parserString(String inputString); Map<String, WordFrequency> parserStringByReturnFrequencyMap(String inputString); void addFixWords(int charPosition, String inputString, StringBuilder[] fixWords); Map<String, String> getEnToCn(); Map<String, String> getCnToEn(); Map<String, WordFrequency> getWordFrequencyMap(List<String> sets); List<WordFrequency> sortWordFrequencyMap(Map<String, WordFrequency> map); List<WordFrequency> getWordFrequency(List<String> sets); Map<Integer, WordFrequency> getWordFrequencyByReturnSortMap(List<String> sets); Map<Integer, WordFrequency> sortWordFrequencyMapToUnsortMap(Map<String, WordFrequency> map); Map<Integer, WordFrequency> sortWordFrequencyMapToSortMap(Map<String, WordFrequency> map); String[] parserEnglishString(String englishString); Map<String, String> getPosEnToCn(); Map<String, String> getPosEnToEn(); Map<String, String> getPosCnToCn(); Map<String, String> getFullEnToCn(); Map<String, String> getFullCnToEn(); Map<String, WordFrequency> parserMixStringByReturnFrequencyMap(String mixedString); void studyNewWord(String study, String token, String posStudy); @Override Map<String, String> getStudyPos(); }
AnalyzerImp implements Analyzer { public List<String> parserString(String inputString) { List<String> outputList= new LinkedList<>(); int inputStringLength= inputString.length(); int forestDepth= StableData.INT_ZERO; int countInputStringLength; StringBuilder[] fixWords= new StringBuilder[StableData.INT_TWO]; fixWords[StableData.INT_ZERO]= new StringBuilder(); fixWords[StableData.INT_ONE]= new StringBuilder(); StringBuilder stringBuilder= new StringBuilder(); int find= StableData.INT_ZERO; Here: for (int charPosition= StableData.INT_ZERO; charPosition< inputStringLength; charPosition += (countInputStringLength!= StableData.INT_ZERO? countInputStringLength: StableData.INT_ONE)) { if(StableData.INT_ONE_TWO_EIGHT> inputString.charAt(charPosition)){ if(fixWords[StableData.INT_ZERO].length()> StableData.INT_ZERO) { if(fixWords[StableData.INT_ZERO].charAt(fixWords[StableData.INT_ZERO].length()- StableData.INT_ONE) < StableData.INT_ONE_TWO_EIGHT) { fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; find= StableData.INT_ONE; continue Here; } fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); } find= StableData.INT_ONE; fixWords[StableData.INT_ZERO].append(inputString.charAt(charPosition)); countInputStringLength= StableData.INT_ONE; continue Here; } if(find== StableData.INT_ONE) { find= StableData.INT_ZERO; outputList.add(fixWords[StableData.INT_ZERO].toString()); } stringBuilder.delete(StableData.INT_ZERO, stringBuilder.length()); stringBuilder= neroController.getBinaryForestRecurWordOneTime(stringBuilder.append(inputString .charAt(charPosition)), inputString, charPosition, inputStringLength, forestRoots, forestDepth , charPosition+ StableData.INT_ONE); String countWordNode= stringBuilder.toString(); int compare= countInputStringLength= countWordNode.length(); if (compare== StableData.INT_ONE) { outputList.add(countWordNode); fixWords[StableData.INT_ZERO].delete(StableData.INT_ZERO, fixWords[StableData.INT_ZERO].length()); fixWords[StableData.INT_ZERO].append(countWordNode); continue Here; } if (compare== StableData.INT_TWO) { countInputStringLength= nlpController.doSlangPartAndPOSCheckForTwoChar(countInputStringLength, outputList , stringBuilder, wordsForest, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_THREE) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doPOSAndEMMCheckOfThree(countInputStringLength, outputList , wordsForest, stringBuilder, fixWords, posController, charPosition, inputString); continue Here; } if (compare== StableData.INT_FOUR) { addFixWords(charPosition, inputString, fixWords); countInputStringLength= nlpController.doSlangCheck(countInputStringLength, outputList, stringBuilder , wordsForest, fixWords, posController, charPosition, inputString); } } return outputList; }  void init(); void initMixed(); List<String> parserMixedString(String mixedString); List<String> parserString(String inputString); Map<String, WordFrequency> parserStringByReturnFrequencyMap(String inputString); void addFixWords(int charPosition, String inputString, StringBuilder[] fixWords); Map<String, String> getEnToCn(); Map<String, String> getCnToEn(); Map<String, WordFrequency> getWordFrequencyMap(List<String> sets); List<WordFrequency> sortWordFrequencyMap(Map<String, WordFrequency> map); List<WordFrequency> getWordFrequency(List<String> sets); Map<Integer, WordFrequency> getWordFrequencyByReturnSortMap(List<String> sets); Map<Integer, WordFrequency> sortWordFrequencyMapToUnsortMap(Map<String, WordFrequency> map); Map<Integer, WordFrequency> sortWordFrequencyMapToSortMap(Map<String, WordFrequency> map); String[] parserEnglishString(String englishString); Map<String, String> getPosEnToCn(); Map<String, String> getPosEnToEn(); Map<String, String> getPosCnToCn(); Map<String, String> getFullEnToCn(); Map<String, String> getFullCnToEn(); Map<String, WordFrequency> parserMixStringByReturnFrequencyMap(String mixedString); void studyNewWord(String study, String token, String posStudy); @Override Map<String, String> getStudyPos();  }