Class LabelEscaper

java.lang.Object
ca.mcscert.jpipe.util.LabelEscaper

public final class LabelEscaper extends Object
Converts a human-readable jPipe element label into a valid Python identifier (snake_case).

The conversion is two-phase:

  1. Unicode NFD normalisation followed by stripping of combining diacritics, so accented characters map to their ASCII base (e.g. ée, üu).
  2. Lowercasing, collapsing any run of non-alphanumeric characters to a single underscore, and stripping leading/trailing underscores. If the result starts with a digit an underscore prefix is added.

Examples:

  • "The system is correct""the_system_is_correct"
  • "Accuracy <= 0.85""accuracy_0_85"
  • "café test""cafe_test"
  • "100% accurate""_100_accurate"
  • Method Details

    • toMethodName

      public static String toMethodName(String label)
      Convert label to a valid snake_case Python identifier.
      Parameters:
      label - the element label to convert; must not be null.
      Returns:
      a non-empty string that is a valid Python identifier.