Esempio n. 1
0
        public virtual void setLastWord(string word)
        {
            Item       tail     = this.relation.getTail();
            FeatureSet features = tail.getFeatures();

            features.setString("name", word);
        }
Esempio n. 2
0
        public virtual void addWord(string word)
        {
            Item       tokenItem = this.tokenToWords.getTokenItem();
            Item       item      = tokenItem.createDaughter();
            FeatureSet features  = item.getFeatures();

            features.setString("name", word);
            this.relation.appendItem(item);
        }
Esempio n. 3
0
        public virtual void addBreak()
        {
            Item tail = this.relation.getTail();

            if (tail != null)
            {
                FeatureSet features = tail.getFeatures();
                features.setString("break", "1");
            }
        }
Esempio n. 4
0
        private void setTokenList(Iterator iterator)
        {
            Relation relation = this.createRelation("Token");

            while (iterator.hasNext())
            {
                Token  token = (Token)iterator.next();
                string word  = token.getWord();
                if (word != null && String.instancehelper_length(word) > 0)
                {
                    Item       item       = relation.appendItem();
                    FeatureSet featureSet = item.getFeatures();
                    featureSet.setString("name", word);
                    featureSet.setString("whitespace", token.getWhitespace());
                    featureSet.setString("prepunctuation", token.getPrepunctuation());
                    featureSet.setString("punc", token.getPostpunctuation());
                    featureSet.setString("file_pos", String.valueOf(token.getPosition()));
                    featureSet.setString("line_number", String.valueOf(token.getLineNumber()));
                }
            }
        }