/* -------------------------------------------------------------------------- */ /* */ /* PHRASE BINARY TREE NODE */ /* */ /* Frans Coenen */ /* */ /* Wednesday 21 December 2005 */ /* */ /* Department of Computer Science */ /* The University of Liverpool */ /* */ /* -------------------------------------------------------------------------- */ //package lucsKDD_ARM; /** Class to describe an individual node in the phrase bin tree. @author Frans Coenen @version 21 December 2005. */ public class PhraseBinTreeNode { /* ------------------------------- */ /* */ /* FIELDS */ /* */ /* ------------------------------- */ /** The phrase represented at the node. */ public String[] phrase = null; /** The first significant words in the phase (i.e. first word that serves to distinguish between classes) --- allows for fast comparison to determine if phrase in test set. */ public String sigWord = null; /** The index of the first significant word in the phrase. */ public int indexSigWord; /** Phrase comprised of wild cards and significant words only. */ public boolean wildCardsAndSigWordsOnly = false; /** The Branch lexicographically before the phrase. */ public PhraseBinTreeNode beforeBranch = null; /** The Branch lexicographically after the phrase. */ public PhraseBinTreeNode afterBranch = null; /** Document numbers in which phrase appears, used for generating table of training set attributes in phrase mode (each attribute representing a phrase) --- not used for test set generation. */ public int[] docNumbers = new int[1]; /* ------------------------------------ */ /* */ /* CONSTRUCTORS */ /* */ /* ------------------------------------ */ /** Three argument constructor. @param newPhrase the given phrase. @param docNum the document number. @param newSigWord the first significant word in the phrase. @param newIndexSigWord the index of the first significant word in the phrase. */ public PhraseBinTreeNode(String[] newPhrase, int docNum, String newSigWord, int newIndexSigWord) { // Initialise and copy phrase phrase = new String[newPhrase.length]; for (int index=0;index