Class ResultUtils
- java.lang.Object
-
- edu.indiana.lib.twinpeaks.search.sru.ss360search.ResultUtils
-
public class ResultUtils extends Object
Data normalization for 360 Search results
-
-
Field Summary
Fields Modifier and Type Field Description static StringANTHRO_PLUSstatic StringJSTOR
-
Constructor Summary
Constructors Constructor Description ResultUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringnormalize(String resultData, String partDataName, String database)Normalize one 360 Search result data item.static StringnormalizeAnthroPlusIssue(String issue)Normalize the issue number (remove the "o." prefix)static StringnormalizeAnthroPlusTitle(String title)Normalize the title (remove trailing " /")static StringnormalizeJstorPageRange(String range)Normalize the page range ("pp. ", "p. " are removed)static StringnormalizeJstorStartPage(String page)Normalize the start page ("pp. ", "p. " are removed)static StringremoveJstorPagePrefix(String page)Remove leading "pages" prefix ("p. ", "pp. ")static StringremovePrefix(String text, String prefix)Remove prefix text
-
-
-
Field Detail
-
ANTHRO_PLUS
public static final String ANTHRO_PLUS
- See Also:
- Constant Field Values
-
JSTOR
public static final String JSTOR
- See Also:
- Constant Field Values
-
-
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 datapartDataName- 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
-
-