test_class.declarator: translationTable
test_class.modifier: private
test_class.original_string: private TranslationTable translationTable;
test_class.type: TranslationTable
test_class.var_name: translationTable
test_class.declarator: testHomoglyphPairs
test_class.modifier: private
test_class.original_string: private List<GlyphPair> testHomoglyphPairs;
test_class.type: List<GlyphPair>
test_class.var_name: testHomoglyphPairs
test_class.file: extra-analysis-homoglyph/src/test/java/org/wikimedia/search/extra/analysis/homoglyph/TranslationTableTest.java
test_class.identifier: TranslationTableTest
test_case.body: @Test
      public void testSortOrderScriptTwoToScriptOne() {
          List<GlyphPair> actual = translationTable.scriptTwoToScriptOneList(testHomoglyphPairs);
          List<GlyphPair> expected = unmodifiableList(asList(
                  new GlyphPair("cd", "ab"),
                  new GlyphPair("fg", "e"),
                  new GlyphPair("j", "hi"),
                  new GlyphPair("l", "k")
          ));
          assertEquals(expected.toString(), actual.toString());
      }
test_case.class_method_signature: TranslationTableTest.testSortOrderScriptTwoToScriptOne()
test_case.full_signature: @Test public void testSortOrderScriptTwoToScriptOne()
test_case.identifier: testSortOrderScriptTwoToScriptOne
test_case.invocations: scriptTwoToScriptOneList unmodifiableList asList assertEquals toString toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSortOrderScriptTwoToScriptOne()
focal_class.declarator: sortByLength = Comparator.comparingInt(gp -> gp.getOriginal().length())
focal_class.modifier: private static final
focal_class.original_string: private static final Comparator<GlyphPair> sortByLength = Comparator.comparingInt(gp -> gp.getOriginal().length());
focal_class.type: Comparator<GlyphPair>
focal_class.var_name: sortByLength
focal_class.declarator: sortByNaturalOrder = Comparator.comparing(GlyphPair::getOriginal)
focal_class.modifier: private static final
focal_class.original_string: private static final Comparator<GlyphPair> sortByNaturalOrder = Comparator.comparing(GlyphPair::getOriginal);
focal_class.type: Comparator<GlyphPair>
focal_class.var_name: sortByNaturalOrder
focal_class.declarator: scriptOneToScriptTwo
focal_class.modifier: private final
focal_class.original_string: private final List<GlyphPair> scriptOneToScriptTwo;
focal_class.type: List<GlyphPair>
focal_class.var_name: scriptOneToScriptTwo
focal_class.declarator: scriptTwoToScriptOne
focal_class.modifier: private final
focal_class.original_string: private final List<GlyphPair> scriptTwoToScriptOne;
focal_class.type: List<GlyphPair>
focal_class.var_name: scriptTwoToScriptOne
focal_class.declarator: script1Reg
focal_class.modifier: private final
focal_class.original_string: private final Pattern script1Reg;
focal_class.type: Pattern
focal_class.var_name: script1Reg
focal_class.declarator: script2Reg
focal_class.modifier: private final
focal_class.original_string: private final Pattern script2Reg;
focal_class.type: Pattern
focal_class.var_name: script2Reg
focal_class.file: extra-analysis-homoglyph/src/main/java/org/wikimedia/search/extra/analysis/homoglyph/TranslationTable.java
focal_class.identifier: TranslationTable
focal_class.class_method_signature: TranslationTable.TranslationTable(Pattern script1Reg, Pattern script2Reg, List<GlyphPair> homoglyphPairs)
focal_class.full_signature: public  TranslationTable(Pattern script1Reg, Pattern script2Reg, List<GlyphPair> homoglyphPairs)
focal_class.identifier: TranslationTable
focal_class.modifiers: public
focal_class.parameters: (Pattern script1Reg, Pattern script2Reg, List<GlyphPair> homoglyphPairs)
focal_class.signature:  TranslationTable(Pattern script1Reg, Pattern script2Reg, List<GlyphPair> homoglyphPairs)
focal_class.class_method_signature: TranslationTable.scriptOneToScriptTwoList(List<GlyphPair> homoglyphPairs)
focal_class.full_signature: @VisibleForTesting @SuppressFBWarnings(value = "OCP_OVERLY_CONCRETE_PARAMETER", justification = "glyph order is semantically important") public final List<GlyphPair> scriptOneToScriptTwoList(List<GlyphPair> homoglyphPairs)
focal_class.identifier: scriptOneToScriptTwoList
focal_class.modifiers: @VisibleForTesting @SuppressFBWarnings(value = "OCP_OVERLY_CONCRETE_PARAMETER", justification = "glyph order is semantically important") public final
focal_class.parameters: (List<GlyphPair> homoglyphPairs)
focal_class.return: List<GlyphPair>
focal_class.signature: List<GlyphPair> scriptOneToScriptTwoList(List<GlyphPair> homoglyphPairs)
focal_class.class_method_signature: TranslationTable.scriptTwoToScriptOneList(List<GlyphPair> homoglyphPairs)
focal_class.full_signature: @VisibleForTesting @SuppressFBWarnings(value = "OCP_OVERLY_CONCRETE_PARAMETER", justification = "glyph order is semantically important") public final List<GlyphPair> scriptTwoToScriptOneList(List<GlyphPair> homoglyphPairs)
focal_class.identifier: scriptTwoToScriptOneList
focal_class.modifiers: @VisibleForTesting @SuppressFBWarnings(value = "OCP_OVERLY_CONCRETE_PARAMETER", justification = "glyph order is semantically important") public final
focal_class.parameters: (List<GlyphPair> homoglyphPairs)
focal_class.return: List<GlyphPair>
focal_class.signature: List<GlyphPair> scriptTwoToScriptOneList(List<GlyphPair> homoglyphPairs)
focal_class.class_method_signature: TranslationTable.replaceScriptOne(StringBuilder scriptOne)
focal_class.full_signature: public void replaceScriptOne(StringBuilder scriptOne)
focal_class.identifier: replaceScriptOne
focal_class.modifiers: public
focal_class.parameters: (StringBuilder scriptOne)
focal_class.return: void
focal_class.signature: void replaceScriptOne(StringBuilder scriptOne)
focal_class.class_method_signature: TranslationTable.translate(StringBuilder scriptToTranslate, List<GlyphPair> scriptList)
focal_class.full_signature: private void translate(StringBuilder scriptToTranslate, List<GlyphPair> scriptList)
focal_class.identifier: translate
focal_class.modifiers: private
focal_class.parameters: (StringBuilder scriptToTranslate, List<GlyphPair> scriptList)
focal_class.return: void
focal_class.signature: void translate(StringBuilder scriptToTranslate, List<GlyphPair> scriptList)
focal_class.class_method_signature: TranslationTable.replaceScriptTwo(StringBuilder scriptTwo)
focal_class.full_signature: public void replaceScriptTwo(StringBuilder scriptTwo)
focal_class.identifier: replaceScriptTwo
focal_class.modifiers: public
focal_class.parameters: (StringBuilder scriptTwo)
focal_class.return: void
focal_class.signature: void replaceScriptTwo(StringBuilder scriptTwo)
focal_class.class_method_signature: TranslationTable.getScript1Reg()
focal_class.full_signature: public Pattern getScript1Reg()
focal_class.identifier: getScript1Reg
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Pattern
focal_class.signature: Pattern getScript1Reg()
focal_class.class_method_signature: TranslationTable.getScript2Reg()
focal_class.full_signature: public Pattern getScript2Reg()
focal_class.identifier: getScript2Reg
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Pattern
focal_class.signature: Pattern getScript2Reg()
focal_method.body: @VisibleForTesting
      @SuppressFBWarnings(value = "OCP_OVERLY_CONCRETE_PARAMETER", justification = "glyph order is semantically important")
      public final List<GlyphPair> scriptTwoToScriptOneList(List<GlyphPair> homoglyphPairs) {
          return homoglyphPairs.stream()
                  .map(GlyphPair::swap)
                  .sorted(sortByLength.reversed().thenComparing(sortByNaturalOrder))
                  .collect((toList()));
      }
focal_method.class_method_signature: TranslationTable.scriptTwoToScriptOneList(List<GlyphPair> homoglyphPairs)
focal_method.full_signature: @VisibleForTesting @SuppressFBWarnings(value = "OCP_OVERLY_CONCRETE_PARAMETER", justification = "glyph order is semantically important") public final List<GlyphPair> scriptTwoToScriptOneList(List<GlyphPair> homoglyphPairs)
focal_method.identifier: scriptTwoToScriptOneList
focal_method.invocations: collect sorted map stream thenComparing reversed toList
focal_method.modifiers: @VisibleForTesting @SuppressFBWarnings(value = "OCP_OVERLY_CONCRETE_PARAMETER", justification = "glyph order is semantically important") public final
focal_method.parameters: (List<GlyphPair> homoglyphPairs)
focal_method.return: List<GlyphPair>
focal_method.signature: List<GlyphPair> scriptTwoToScriptOneList(List<GlyphPair> homoglyphPairs)