public string ToStringNewFormat()
        {
            var sb = new StringBuilder();

            sb.AppendFormat(

                "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}\t{12}\t{13}\t{14}\t{15}\t{16}\t{17}\n",

                SampleVoltage.ToString(NumberFormatInfo.InvariantInfo),
                SampleCurrent.ToString(NumberFormatInfo.InvariantInfo),
                EquivalentResistance.ToString(NumberFormatInfo.InvariantInfo),
                FileName.ToString(NumberFormatInfo.InvariantInfo),
                Rload.ToString(NumberFormatInfo.InvariantInfo),
                Uwhole.ToString(NumberFormatInfo.InvariantInfo),
                URload.ToString(NumberFormatInfo.InvariantInfo),
                U0sample.ToString(NumberFormatInfo.InvariantInfo),
                U0whole.ToString(NumberFormatInfo.InvariantInfo),
                U0Rload.ToString(NumberFormatInfo.InvariantInfo),
                U0Gate.ToString(NumberFormatInfo.InvariantInfo),
                R0sample.ToString(NumberFormatInfo.InvariantInfo),
                REsample.ToString(NumberFormatInfo.InvariantInfo),
                Temperature0.ToString(NumberFormatInfo.InvariantInfo),
                TemperatureE.ToString(NumberFormatInfo.InvariantInfo),
                kAmpl.ToString(NumberFormatInfo.InvariantInfo),
                NAver.ToString(NumberFormatInfo.InvariantInfo),
                Vg.ToString(NumberFormatInfo.InvariantInfo)

                );

            return(sb.ToString());
        }
Example #2
0
        public void Vectorize(List <string> features)
        {
            Init();

            Sentences.ForEach(s => {
                List <string> wordLemmas = new List <string>();
                s.Words.ForEach(word => {
                    if (features.Contains(word.Lemma))
                    {
                        wordLemmas.Add(word.Lemma);
                    }
                });
                Vec sentenceVec = Vg.Sent2Vec(wordLemmas);

                s.Vector = sentenceVec.VecNodes.ToArray();
            });
        }
Example #3
0
        public Analysis(string[] Input)
        {
            CFG = new cfg(Input);
            FirstSetBuilder first = new FirstSetBuilder(CFG);

            this.FirstSets = first.FirstSets;
            this.Va        = new Dictionary <int, char>()
            {
            };
            this.Vg = new Dictionary <int, char>()
            {
            };
            char empty = System.Configuration.ConfigurationManager.AppSettings["Empty"][0];
            char end   = System.Configuration.ConfigurationManager.AppSettings["End"][0];
            int  k     = 0;

            for (int i = 0; i < CFG.Vt.Count; ++i)
            {
                char c = CFG.Vt.ElementAt(i);
                if (c != empty)
                {
                    Va.Add(k++, c);
                }
            }
            Va.Add(k++, end);
            for (int i = 0; i < CFG.Vn.Count; ++i)
            {
                char c = CFG.Vn.ElementAt(i);
                Vg.Add(i, c);
            }
            TableBuilder tableBuilder = new TableBuilder(CFG, FirstSets);

            this.Table       = tableBuilder.Table;
            this.ItemSetMap  = tableBuilder.ItemSetMap;
            this._ItemSetMap = tableBuilder._ItemSetMap;
        }