Class AuthorMatchers

java.lang.Object
eu.openaire.common.author.AuthorMatchers

public class AuthorMatchers extends Object
Helper class providing methods to match authors by their names.
  • Constructor Details

    • AuthorMatchers

      public AuthorMatchers()
  • Method Details

    • matchEqualsIgnoreCase

      public static boolean matchEqualsIgnoreCase(String a1, String a2)
      Checks whether two author names are equal, ignoring case differences.
      Parameters:
      a1 - The first author name.
      a2 - The second author name.
      Returns:
      true if the names are equal (case-insensitive), otherwise false.
    • matchOrderedTokenAndAbbreviations

      public static Optional<Double> matchOrderedTokenAndAbbreviations(String a1, String a2)
      Checks whether two author names match based on ordered tokens and abbreviations.

      This method leverages the OrderedTokenAndAbbreviationsMatcher to compare names by considering token order and abbreviation expansion.

      Parameters:
      a1 - The first author name.
      a2 - The second author name.
      Returns:
      An Optional<Double> with a confidence score (1.0 if a match is found), or empty if no match.
    • removeMatches

      public static List<String> removeMatches(List<String> base_authors, List<String> enriching_authors, java.util.function.BiFunction<String,String,Boolean> matchingFunc)
      Removes matching authors from two lists using a custom matching function.

      This method iterates through the lists of base authors and enriching authors, applying the given matching function to determine matches. If a match is found, both elements are removed from their respective lists.

      Parameters:
      base_authors - The list of base authors.
      enriching_authors - The list of enriching authors.
      matchingFunc - A function that determines whether two author names match.
      Returns:
      A list containing matched base-enriching authors pairs.
    • findMatches

      public static <BA, EA> List<AuthorMatch<BA,EA>> findMatches(List<BA> base_authors, List<EA> enrichment_authors, List<AuthorMatcherStep<BA,EA>> steps)
      Finds matches between a list of base authors and a list of enriching authors using a sequence of matching steps.

      Each step in the list of AuthorMatcherStep objects applies a specific matching strategy. The result is a list of successful matches.

      Type Parameters:
      BA - The type representing the base author data.
      EA - The type representing the enriching author data.
      Parameters:
      base_authors - The list of base authors.
      enrichment_authors - The list of enriching authors.
      steps - The list of matching steps to apply.
      Returns:
      A list of AuthorMatch objects representing the matches found.