@Test public void createDocOrgRelationMatcherVoters() { List<AffOrgMatchVoter> voters = DocOrgRelationMatcherFactory.createDocOrgRelationMatcherVoters(); assertDocOrgRelationMatcherVoters(voters); }
public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { CommonWordsVoter commonOrgNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgNameWordsVoter.setMatchStrength(0.916f); CommonWordsVoter commonOrgAlternativeNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgAlternativeNameWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonOrgAlternativeNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgAlternativeNameWordsVoter.setMatchStrength(0.976f); CommonAffSectionWordsVoter commonAffNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffNameSectionWordsVoter.setMatchStrength(0.966f); CommonAffSectionWordsVoter commonAffAlternativeNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffAlternativeNameSectionWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonAffAlternativeNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffAlternativeNameSectionWordsVoter.setMatchStrength(1); return ImmutableList.of( createNameCountryStrictMatchVoter(1f, new GetOrgNameFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgShortNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), commonOrgNameWordsVoter, commonOrgAlternativeNameWordsVoter, commonAffNameSectionWordsVoter, commonAffAlternativeNameSectionWordsVoter ); }
DocOrgRelationMatcherFactory { public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { CommonWordsVoter commonOrgNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgNameWordsVoter.setMatchStrength(0.916f); CommonWordsVoter commonOrgAlternativeNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgAlternativeNameWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonOrgAlternativeNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgAlternativeNameWordsVoter.setMatchStrength(0.976f); CommonAffSectionWordsVoter commonAffNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffNameSectionWordsVoter.setMatchStrength(0.966f); CommonAffSectionWordsVoter commonAffAlternativeNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffAlternativeNameSectionWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonAffAlternativeNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffAlternativeNameSectionWordsVoter.setMatchStrength(1); return ImmutableList.of( createNameCountryStrictMatchVoter(1f, new GetOrgNameFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgShortNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), commonOrgNameWordsVoter, commonOrgAlternativeNameWordsVoter, commonAffNameSectionWordsVoter, commonAffAlternativeNameSectionWordsVoter ); } }
DocOrgRelationMatcherFactory { public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { CommonWordsVoter commonOrgNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgNameWordsVoter.setMatchStrength(0.916f); CommonWordsVoter commonOrgAlternativeNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgAlternativeNameWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonOrgAlternativeNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgAlternativeNameWordsVoter.setMatchStrength(0.976f); CommonAffSectionWordsVoter commonAffNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffNameSectionWordsVoter.setMatchStrength(0.966f); CommonAffSectionWordsVoter commonAffAlternativeNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffAlternativeNameSectionWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonAffAlternativeNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffAlternativeNameSectionWordsVoter.setMatchStrength(1); return ImmutableList.of( createNameCountryStrictMatchVoter(1f, new GetOrgNameFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgShortNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), commonOrgNameWordsVoter, commonOrgAlternativeNameWordsVoter, commonAffNameSectionWordsVoter, commonAffAlternativeNameSectionWordsVoter ); } private  DocOrgRelationMatcherFactory(); }
DocOrgRelationMatcherFactory { public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { CommonWordsVoter commonOrgNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgNameWordsVoter.setMatchStrength(0.916f); CommonWordsVoter commonOrgAlternativeNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgAlternativeNameWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonOrgAlternativeNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgAlternativeNameWordsVoter.setMatchStrength(0.976f); CommonAffSectionWordsVoter commonAffNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffNameSectionWordsVoter.setMatchStrength(0.966f); CommonAffSectionWordsVoter commonAffAlternativeNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffAlternativeNameSectionWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonAffAlternativeNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffAlternativeNameSectionWordsVoter.setMatchStrength(1); return ImmutableList.of( createNameCountryStrictMatchVoter(1f, new GetOrgNameFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgShortNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), commonOrgNameWordsVoter, commonOrgAlternativeNameWordsVoter, commonAffNameSectionWordsVoter, commonAffAlternativeNameSectionWordsVoter ); } private  DocOrgRelationMatcherFactory(); static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, 
            String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold); static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters(); }
DocOrgRelationMatcherFactory { public static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters() { CommonWordsVoter commonOrgNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgNameWordsVoter.setMatchStrength(0.916f); CommonWordsVoter commonOrgAlternativeNameWordsVoter = new CommonWordsVoter(ImmutableList.of(',', ';'), 2, 0.71, WITH_REGARD_TO_ORG_WORDS); commonOrgAlternativeNameWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonOrgAlternativeNameWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.9)); commonOrgAlternativeNameWordsVoter.setMatchStrength(0.976f); CommonAffSectionWordsVoter commonAffNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffNameSectionWordsVoter.setMatchStrength(0.966f); CommonAffSectionWordsVoter commonAffAlternativeNameSectionWordsVoter = new CommonAffSectionWordsVoter(ImmutableList.of(',', ';'), 1, 0.81); commonAffAlternativeNameSectionWordsVoter.setGetOrgNamesFunction(new GetOrgAlternativeNamesFunction()); commonAffAlternativeNameSectionWordsVoter.setCommonSimilarWordCalculator(new CommonSimilarWordCalculator(0.85)); commonAffAlternativeNameSectionWordsVoter.setMatchStrength(1); return ImmutableList.of( createNameCountryStrictMatchVoter(1f, new GetOrgNameFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameCountryStrictMatchVoter(1f, new GetOrgShortNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), createSectionedNameStrictCountryLooseMatchVoter(1f, new GetOrgShortNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgNameFunction()), createSectionedNameLevenshteinCountryLooseMatchVoter(1f, new GetOrgAlternativeNamesFunction()), commonOrgNameWordsVoter, commonOrgAlternativeNameWordsVoter, commonAffNameSectionWordsVoter, commonAffAlternativeNameSectionWordsVoter ); } private  DocOrgRelationMatcherFactory(); static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, 
            String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold); static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters();  }