Example #1
0
        //[Description("The srcML file to use.")]
        //[Required]
        //public string File { get; set; }

        public override void Execute()
        {
            //string srcMLFormat;

            ////construct the necessary srcML wrapper unit tags
            //XmlNamespaceManager xnm = SrcML.SrcML.NamespaceManager;

            //StringBuilder namespaceDecls = new StringBuilder();
            //foreach (string prefix in xnm)
            //{
            //    if (prefix != string.Empty && !prefix.StartsWith("xml", StringComparison.InvariantCultureIgnoreCase))
            //    {
            //        if (prefix.Equals("src", StringComparison.InvariantCultureIgnoreCase))
            //        {
            //            namespaceDecls.AppendFormat("xmlns=\"{0}\" ", xnm.LookupNamespace(prefix));
            //        }
            //        else
            //        {
            //            namespaceDecls.AppendFormat("xmlns:{0}=\"{1}\" ", prefix, xnm.LookupNamespace(prefix));
            //        }
            //    }
            //}
            //srcMLFormat = string.Format("<unit {0}>{{0}}</unit>", namespaceDecls.ToString());

            //string testSrcML = "<class>class <name>foo</name> <block>{<private type=\"default\"><decl_stmt><decl><type><name>bool</name></type> <name>MyVariable</name></decl>;</decl_stmt></private>}</block>;</class>";
            //XElement xml = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);
            //FieldContext fc = ContextBuilder.BuildFieldContext(xml.Descendants(SRC.Declaration).First());

            //FieldDeclarationNode fdn = new FieldDeclarationNode("myVariable", fc);
            ////var splitter = new ConservativeIdSplitter();
            ////var tagger = new UnigramTagger();
            ////var posData = new PCKimmoPartOfSpeechData();

            //FieldRule rule = new FieldRule();
            //rule.ConstructSwum(fdn);
            //Console.WriteLine(fdn.ToString());

            Console.WriteLine(SwumConfiguration.GetSetting("PCKimmoPartOfSpeechData.TwoDictFile"));
        }
 public void TestGetSetting_MissingSetting()
 {
     Assert.IsNull(SwumConfiguration.GetSetting("NonExistentSetting"));
 }
 public void TestGetSetting()
 {
     Assert.AreEqual("lib/dict.2.txt", SwumConfiguration.GetSetting("PCKimmoPartOfSpeechData.TwoDictFile"));
 }