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); }
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()); }
internal override string Extract(History h, PairsHolder pH) { string word = base.Extract(h, pH); return(lexicon.GetMapping(word)); }