Class ResultUtils


  • public class ResultUtils
    extends Object
    Data normalization for 360 Search results
    • Constructor Detail

      • ResultUtils

        public ResultUtils()
    • Method Detail

      • normalize

        public static String normalize​(String resultData,
                                       String partDataName,
                                       String database)
        Normalize one 360 Search result data item. Essentially, just dispatch the proper normalization method for this result, based on the data element name and origin database
        Parameters:
        resultdata - Result data
        partDataName - Data element name (spage, creator, etc)
        databse - The origin database (JST, EAP, etc)
        Returns:
        The normalized result (at a minimum, we always trim() the text)
      • normalizeAnthroPlusIssue

        public static String normalizeAnthroPlusIssue​(String issue)
        Normalize the issue number (remove the "o." prefix)
        Parameters:
        issue - The issue number
        Returns:
        A normalized issue
      • normalizeAnthroPlusTitle

        public static String normalizeAnthroPlusTitle​(String title)
        Normalize the title (remove trailing " /")
        Parameters:
        pages - The page range text
        Returns:
        The normalized title
      • normalizeJstorPageRange

        public static String normalizeJstorPageRange​(String range)
        Normalize the page range ("pp. ", "p. " are removed)
        Parameters:
        pages - The page range text
        Returns:
        The normalized range
      • normalizeJstorStartPage

        public static String normalizeJstorStartPage​(String page)
        Normalize the start page ("pp. ", "p. " are removed)
        Parameters:
        pages - The start page text
        Returns:
        The normalized starting page
      • removeJstorPagePrefix

        public static String removeJstorPagePrefix​(String page)
        Remove leading "pages" prefix ("p. ", "pp. ")
        Parameters:
        page - Page, page range, etc.
        Returns:
        normalized page numbers
      • removePrefix

        public static String removePrefix​(String text,
                                          String prefix)
        Remove prefix text
        Parameters:
        text - Text item to edit
        prefix - The text we want to remove
        Returns:
        Prefix-free, trimmed text