public static void AddSeparatorFeature(IList <string> features, string featureType, CoreLabel label, FeatureFactory.FeatureComponent feature, State.HeadPosition separator) { if (separator == null) { return; } string value = GetFeatureFromCoreLabel(label, feature); features.Add(featureType + value + "-" + separator); }
public static void AddSeparatorFeatures(IList <string> features, CoreLabel s0Label, CoreLabel s1Label, State.HeadPosition s0Separator, State.HeadPosition s1Separator) { bool between = false; if ((s0Separator != null && (s0Separator == State.HeadPosition.Both || s0Separator == State.HeadPosition.Left)) || (s1Separator != null && (s1Separator == State.HeadPosition.Both || s1Separator == State.HeadPosition.Right))) { between = true; } AddSeparatorFeature(features, "s0sep-", s0Separator); AddSeparatorFeature(features, "s1sep-", s1Separator); AddSeparatorFeature(features, "s0ws0sep-", s0Label, FeatureFactory.FeatureComponent.Headword, s0Separator); AddSeparatorFeature(features, "s0ws1sep-", s0Label, FeatureFactory.FeatureComponent.Headword, s1Separator); AddSeparatorFeature(features, "s1ws0sep-", s1Label, FeatureFactory.FeatureComponent.Headword, s0Separator); AddSeparatorFeature(features, "s1ws1sep-", s1Label, FeatureFactory.FeatureComponent.Headword, s1Separator); AddSeparatorFeature(features, "s0cs0sep-", s0Label, FeatureFactory.FeatureComponent.Value, s0Separator); AddSeparatorFeature(features, "s0cs1sep-", s0Label, FeatureFactory.FeatureComponent.Value, s1Separator); AddSeparatorFeature(features, "s1cs0sep-", s1Label, FeatureFactory.FeatureComponent.Value, s0Separator); AddSeparatorFeature(features, "s1cs1sep-", s1Label, FeatureFactory.FeatureComponent.Value, s1Separator); AddSeparatorFeature(features, "s0ts0sep-", s0Label, FeatureFactory.FeatureComponent.Headtag, s0Separator); AddSeparatorFeature(features, "s0ts1sep-", s0Label, FeatureFactory.FeatureComponent.Headtag, s1Separator); AddSeparatorFeature(features, "s1ts0sep-", s1Label, FeatureFactory.FeatureComponent.Headtag, s0Separator); AddSeparatorFeature(features, "s1ts1sep-", s1Label, FeatureFactory.FeatureComponent.Headtag, s1Separator); if (s0Label != null && s1Label != null) { AddSeparatorFeature(features, "s0wsb-", s0Label, FeatureFactory.FeatureComponent.Headword, between); AddSeparatorFeature(features, "s1wsb-", s1Label, FeatureFactory.FeatureComponent.Headword, between); AddSeparatorFeature(features, "s0csb-", s0Label, FeatureFactory.FeatureComponent.Value, between); AddSeparatorFeature(features, "s1csb-", s1Label, FeatureFactory.FeatureComponent.Value, between); AddSeparatorFeature(features, "s0tsb-", s0Label, FeatureFactory.FeatureComponent.Headtag, between); AddSeparatorFeature(features, "s1tsb-", s1Label, FeatureFactory.FeatureComponent.Headtag, between); AddSeparatorFeature(features, "s0cs1csb-", s0Label, FeatureFactory.FeatureComponent.Value, s1Label, FeatureFactory.FeatureComponent.Value, between); } }
public static void AddSeparatorFeature(IList <string> features, string featureType, State.HeadPosition separator) { if (separator == null) { return; } features.Add(featureType + separator); }