Record Class ConceptNode
java.lang.Object
java.lang.Record
org.ek9lang.assist.ConceptNode
- Record Components:
ring0- Core synonyms (weight 1.0)ring1- Close relatives (weight 0.8)ring2- Related concepts (weight 0.6)ring3- Broader context (weight 0.4)ring4- Distant associations (weight 0.2)ek9Links- Actual EK9 keywords/types for -h suggestions
public record ConceptNode(Set<String> ring0, Set<String> ring1, Set<String> ring2, Set<String> ring3, Set<String> ring4, Set<String> ek9Links)
extends Record
A concept with concentric rings of weighted related terms and EK9 keyword links.
Ring 0 contains the closest synonyms (weight 1.0), Ring 4 the most distant (weight 0.2).
The ek9Links set contains actual EK9 keywords/types that the concept maps to.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallTerms()Union of all terms across all rings.ek9Links()Returns the value of theek9Linksrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ring0()Returns the value of thering0record component.ring1()Returns the value of thering1record component.ring2()Returns the value of thering2record component.ring3()Returns the value of thering3record component.ring4()Returns the value of thering4record component.intFind which ring a term belongs to.static doubleringWeight(int ring) Get the weight for a given ring number.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConceptNode
public ConceptNode(Set<String> ring0, Set<String> ring1, Set<String> ring2, Set<String> ring3, Set<String> ring4, Set<String> ek9Links) Creates an instance of aConceptNoderecord class.- Parameters:
ring0- the value for thering0record componentring1- the value for thering1record componentring2- the value for thering2record componentring3- the value for thering3record componentring4- the value for thering4record componentek9Links- the value for theek9Linksrecord component
-
-
Method Details
-
ringOf
Find which ring a term belongs to.- Returns:
- ring number (0-4) or -1 if not found
-
ringWeight
public static double ringWeight(int ring) Get the weight for a given ring number.- Returns:
- weight (1.0 to 0.2) or 0.0 for invalid ring
-
allTerms
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
ring0
-
ring1
-
ring2
-
ring3
-
ring4
-
ek9Links
-