Class ConceptRegistry

java.lang.Object
org.ek9lang.assist.ConceptRegistry

public final class ConceptRegistry extends Object
Immutable registry of concept nodes with forward and reverse indexes. Provides weighted query expansion for -q and keyword suggestions for -h. Pre-computed at construction time for sub-millisecond query-time performance.
  • Method Details

    • createDefault

      public static ConceptRegistry createDefault()
      Create the default registry with all concept nodes.
    • expandTokens

      public Map<String,Double> expandTokens(Set<String> inputTokens)
      Expand input tokens using concept associations. Depth-adaptive: fewer input tokens allow broader expansion. Returns a map of term to maximum ring weight across all matching concepts.
      Parameters:
      inputTokens - the tokenized query terms
      Returns:
      weighted token map (original tokens get weight 1.0)
    • suggestEk9Keywords

      public Set<String> suggestEk9Keywords(String term)
      Suggest EK9 keywords/types related to a term. Used by -h to offer suggestions when no direct help is found.
      Parameters:
      term - the search term (lowercase)
      Returns:
      set of EK9 keyword/type names, empty if no concept matches
    • findConcepts

      public List<ConceptRegistry.ConceptHit> findConcepts(String term)
      Find all concepts that contain a term, with ring distance.