MSTParser.DependencyPipe.CreateFeatureVector C# (CSharp) Method

CreateFeatureVector() public method

public CreateFeatureVector ( string toks, string pos, string posA, int word, string type, bool attR, bool childFeatures, FeatureVector fv ) : FeatureVector
toks string
pos string
posA string
word int
type string
attR bool
childFeatures bool
fv FeatureVector
return FeatureVector
        public virtual FeatureVector CreateFeatureVector(string[] toks,
                                                 string[] pos,
                                                 string[] posA,
                                                 int word,
                                                 string type,
                                                 bool attR,
                                                 bool childFeatures,
                                                 FeatureVector fv)
        {
            if (!Labeled) return fv;

            string att = "";
            if (attR)
                att = "RA";
            else
                att = "LA";

            att += "&" + childFeatures;

            string w = toks[word];
            string wP = pos[word];

            string wPm1 = word > 0 ? pos[word - 1] : "STR";
            string wPp1 = word < pos.Length - 1 ? pos[word + 1] : "END";

            Add("NTS1=" + type + "&" + att, 1.0, fv);
            Add("ANTS1=" + type, 1.0, fv);
            for (int i = 0; i < 2; i++)
            {
                string suff = i < 1 ? "&" + att : "";
                suff = "&" + type + suff;

                Add("NTH=" + w + " " + wP + suff, 1.0, fv);
                Add("NTI=" + wP + suff, 1.0, fv);
                Add("NTIA=" + wPm1 + " " + wP + suff, 1.0, fv);
                Add("NTIB=" + wP + " " + wPp1 + suff, 1.0, fv);
                Add("NTIC=" + wPm1 + " " + wP + " " + wPp1 + suff, 1.0, fv);
                Add("NTJ=" + w + suff, 1.0, fv); //this
            }

            return fv;
        }

Same methods

DependencyPipe::CreateFeatureVector ( string toks, string pos, string labs, int deps ) : FeatureVector
DependencyPipe::CreateFeatureVector ( string toks, string pos, string posA, int small, int large, bool attR, FeatureVector fv ) : FeatureVector