Example #1
0
        public TextMiningEngine(PhenotypeEngine phenotypeEngine)
        {
            Console.WriteLine("TextMiningEngine initialization ...");
            stringBuilder = new System.Text.StringBuilder();
            client        = new HttpClient();

            symptomsList = phenotypeEngine.SymptomsList;
            //////////////////
            //symptomsList = new List<Symptom>();
            //GetSymptomsList();
            ///////////////
            //getSymptomsListBeta();

            //Preparing dictionary
            //Construct dictionnary for symptoms
            TrieDictionary dict = new TrieDictionary();

            foreach (Symptom pheno in symptomsList)
            {
                dict.addEntry(new com.aliasi.dict.DictionaryEntry(pheno.Name, "PHENOTYPE"));
                foreach (string synonym in pheno.Synonyms)
                {
                    dict.addEntry(new com.aliasi.dict.DictionaryEntry(synonym, "PHENOTYPE"));
                }
            }

            TokenizerFactory     tokenizerFactory = IndoEuropeanTokenizerFactory.INSTANCE;
            WeightedEditDistance editDistance     = new FixedWeightEditDistance(0, -1, -1, -1, System.Double.NaN);

            double maxDistance = 0.0;

            chunker = new ApproxDictionaryChunker(dict, tokenizerFactory, editDistance, maxDistance);

            /*
             * //////////////////////////////////////////
             * //FOR HMM PREPARATION
             * string pathWithoutSettings = Environment.GetEnvironmentVariable("RD_AGGREGATOR_SETTINGS").Substring(0, Environment.GetEnvironmentVariable("RD_AGGREGATOR_SETTINGS").Length - 14);
             * string completePath = $"{pathWithoutSettings}\\Aggregator\\tools\\model.test";
             * Console.WriteLine(completePath);
             * java.io.File modelFile = new java.io.File(completePath);
             * //chunkerHMM = Conversion.Converter.Convert($"{pathWithoutSettings}\\Aggregator\\tools\\model.test");
             * //java.io.File modelFile = new java.io.File(@"C: \Users\CharlesCOUSYN\Desktop\qhskdjhq.txt");
             * chunkerHMM = (Chunker)AbstractExternalizable.readObject(modelFile);
             *
             * //////////////////////////////////////////
             */
            Console.WriteLine("TextMiningEngine initialization finished");
        }
Example #2
0
        public TextMiningEngine()
        {
            Console.WriteLine("TextMiningEngine initialization ...");
            client       = new HttpClient();
            symptomsList = new List <Symptom>();
            GetSymptomsList();
            //getSymptomsListBeta();

            //Preparing dictionary
            //Construct dictionnary for symptoms
            TrieDictionary dict = new TrieDictionary();

            foreach (Symptom pheno in symptomsList)
            {
                dict.addEntry(new com.aliasi.dict.DictionaryEntry(pheno.Name, "PHENOTYPE"));
                foreach (string synonym in pheno.Synonyms)
                {
                    dict.addEntry(new com.aliasi.dict.DictionaryEntry(synonym, "PHENOTYPE"));
                }
            }

            TokenizerFactory     tokenizerFactory = IndoEuropeanTokenizerFactory.INSTANCE;
            WeightedEditDistance editDistance     = new FixedWeightEditDistance(0, -1, -1, -1, System.Double.NaN);

            double maxDistance = 0.0;

            chunker = new ApproxDictionaryChunker(dict, tokenizerFactory, editDistance, maxDistance);

            //////////////////////////////////////////
            //FOR HMM PREPARATION
            java.io.File modelFile = new java.io.File($"{Environment.GetEnvironmentVariable("RD_AGGREGATOR_SETTINGS")}/Aggregator/tools/model.test");

            chunkerHMM = (Chunker)AbstractExternalizable.readObject(modelFile);

            //////////////////////////////////////////
            Console.WriteLine("TextMiningEngine initialization finished");
        }