コード例 #1
0
        public virtual void AddDistsimFeatures(IList <string> features, CoreLabel label, string featureName)
        {
            if (label == null)
            {
                return;
            }
            string word    = GetFeatureFromCoreLabel(label, FeatureFactory.FeatureComponent.Headword);
            string tag     = GetFeatureFromCoreLabel(label, FeatureFactory.FeatureComponent.Headtag);
            string cluster = distsim.GetMapping(word);

            features.Add(featureName + "dis-" + cluster);
            features.Add(featureName + "disT-" + cluster + "-" + tag);
        }
コード例 #2
0
        internal override string Extract(History h, PairsHolder pH)
        {
            StringBuilder sb = new StringBuilder();

            for (int j = left; j <= right; j++)
            {
                string word    = pH.GetWord(h, j);
                string distSim = lexicon.GetMapping(word);
                sb.Append(distSim);
                if (j < right)
                {
                    sb.Append('|');
                }
            }
            return(sb.ToString());
        }
コード例 #3
0
        internal override string Extract(History h, PairsHolder pH)
        {
            string word = base.Extract(h, pH);

            return(lexicon.GetMapping(word));
        }