3333import java .util .stream .Collectors ;
3434import java .util .stream .Stream ;
3535
36- import static org .aika .corpus .InterprNode .State .SELECTED ;
37- import static org .aika .corpus .InterprNode .State .UNKNOWN ;
36+ import static org .aika .corpus .InterpretationNode .State .SELECTED ;
37+ import static org .aika .corpus .InterpretationNode .State .UNKNOWN ;
3838
3939/**
4040 * The {@code Document} class represents a single document which may be either used for processing a text or as
@@ -62,7 +62,7 @@ public class Document implements Comparable<Document> {
6262 public int searchNodeIdCounter = 0 ;
6363 public int searchStepCounter = 0 ;
6464
65- public InterprNode bottom = new InterprNode (this , -1 , 0 , 0 );
65+ public InterpretationNode bottom = new InterpretationNode (this , -1 , 0 , 0 );
6666
6767 public Model model ;
6868 public int threadId ;
@@ -88,9 +88,9 @@ public class Document implements Comparable<Document> {
8888
8989 public SearchNode rootSearchNode = new SearchNode (this , null , null , null , -1 , Collections .emptySet (), false );
9090 public SearchNode selectedSearchNode = null ;
91- public List <InterprNode > rootRefs ;
91+ public List <InterpretationNode > rootRefs ;
9292 public ArrayList <Candidate > candidates ;
93- public List <InterprNode > bestInterpretation = null ;
93+ public List <InterpretationNode > bestInterpretation = null ;
9494
9595
9696 public static Comparator <NodeActivation > ACTIVATIONS_OUTPUT_COMPARATOR = (act1 , act2 ) -> {
@@ -170,7 +170,7 @@ public void propagate() {
170170 private void expandRootRefinement () {
171171 rootRefs = new ArrayList <>();
172172 rootRefs .add (bottom );
173- for (InterprNode pn : bottom .children ) {
173+ for (InterpretationNode pn : bottom .children ) {
174174 if (pn .state == SELECTED || (pn .isPrimitive () && pn .conflicts .primary .isEmpty () && pn .conflicts .secondary .isEmpty ())) {
175175 rootRefs .add (pn );
176176 }
@@ -181,14 +181,14 @@ private void expandRootRefinement() {
181181 public void generateCandidates () {
182182 TreeSet <Candidate > tmp = new TreeSet <>();
183183 int i = 0 ;
184- for (InterprNode cn : bottom .children ) {
184+ for (InterpretationNode cn : bottom .children ) {
185185 if (cn .state == UNKNOWN ) {
186186 tmp .add (new Candidate (cn , i ++));
187187 }
188188 }
189189
190190 long v = visitedCounter ++;
191- for (InterprNode n : rootRefs ) {
191+ for (InterpretationNode n : rootRefs ) {
192192 markCandidateSelected (n , v );
193193 }
194194
@@ -209,7 +209,7 @@ public void generateCandidates() {
209209 }
210210
211211
212- private static void markCandidateSelected (InterprNode n , long v ) {
212+ private static void markCandidateSelected (InterpretationNode n , long v ) {
213213 if (n .neuronActivations != null ) {
214214 for (Activation act : n .neuronActivations ) {
215215 act .visited = v ;
@@ -240,7 +240,7 @@ public void process() {
240240 SearchNode child = new SearchNode (this , rootSearchNode , null , c , 0 , rootRefs , false );
241241 SearchNode .search (this , child );
242242
243- ArrayList <InterprNode > results = new ArrayList <>();
243+ ArrayList <InterpretationNode > results = new ArrayList <>();
244244 results .add (bottom );
245245 if (selectedSearchNode != null ) {
246246 selectedSearchNode .reconstructSelectedResult (this );
@@ -365,7 +365,7 @@ public String neuronActivationsToString(SearchNode sn, boolean withWeights, bool
365365 Set <Activation > acts = new TreeSet <>(ACTIVATIONS_OUTPUT_COMPARATOR );
366366
367367 for (INeuron n : activatedNeurons ) {
368- Stream <Activation > s = Activation .select (this , n , null , null , null , null , InterprNode .Relation .CONTAINED_IN );
368+ Stream <Activation > s = Activation .select (this , n , null , null , null , null , InterpretationNode .Relation .CONTAINED_IN );
369369 acts .addAll (s .collect (Collectors .toList ()));
370370 }
371371
@@ -500,10 +500,10 @@ public void propagateWeight(int round, Activation act) {
500500 }
501501
502502
503- public NormWeight adjustWeight (SearchNode cand , Collection <InterprNode > changed , long visitedModified ) {
503+ public NormWeight adjustWeight (SearchNode cand , Collection <InterpretationNode > changed , long visitedModified ) {
504504 long v = visitedCounter ++;
505505
506- for (InterprNode n : changed ) {
506+ for (InterpretationNode n : changed ) {
507507 addAllActs (n .getNeuronActivations ());
508508 }
509509
@@ -524,7 +524,7 @@ private void addAllActs(Collection<Activation> acts) {
524524
525525
526526 public void add (int round , Activation act ) {
527- if (act .rounds .isQueued (round ) || act .key .interpretation .state == InterprNode .State .UNKNOWN ) return ;
527+ if (act .rounds .isQueued (round ) || act .key .interpretation .state == InterpretationNode .State .UNKNOWN ) return ;
528528
529529 TreeSet <Activation > q ;
530530 if (round < queue .size ()) {
0 commit comments