Class Normalizer

java.lang.Object
me.nickhanson.codeforge.evaluator.Normalizer

public final class Normalizer extends Object
Utility class for normalizing strings for evaluation. Provides methods to standardize strings by trimming whitespace, converting to lowercase, collapsing multiple spaces, and stripping punctuation.
Author:
Nick Hanson
  • Method Details

    • basic

      public static String basic(String s)
      Performs basic normalization on the input string: - Trims leading and trailing whitespace - Converts to lowercase - Collapses multiple whitespace characters into a single space
      Parameters:
      s - The input string to normalize
      Returns:
      The normalized string
    • collapseWhitespace

      public static String collapseWhitespace(String s)
      Collapses multiple consecutive whitespace characters into a single space.
      Parameters:
      s - The input string
      Returns:
      The string with collapsed whitespace
    • stripPunctuation

      public static String stripPunctuation(String s)
      Strips all punctuation characters from the input string.
      Parameters:
      s - The input string
      Returns:
      The string without punctuation