Exemplo n.º 1
0
        public static Dictionary <string, ProcessedTermEntry> ReadFromFile(string inputFile)
        {
            string inputStr = File.ReadAllText(inputFile, Encoding.UTF8);

            ProcessedTermEntry[] terms = MPFrameworkFunctions.DeserializeString <ProcessedTermEntry[]>(inputStr);
            Dictionary <string, ProcessedTermEntry> res = new Dictionary <string, ProcessedTermEntry>();

            foreach (ProcessedTermEntry pte in terms)
            {
                if (!res.ContainsKey(pte.lowercaceForm))
                {
                    res.Add(pte.lowercaceForm, pte);
                }
            }
            return(res);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the configuration from a specified <c>inputFile</c>.
        /// </summary>
        /// <param name='inputFile'>
        /// Input file.
        /// </param>
        public void Load(string inputFile)
        {
            string inputStr             = File.ReadAllText(inputFile, Encoding.UTF8);
            MPAlignerConfiguration conf = MPFrameworkFunctions.DeserializeString <MPAlignerConfiguration>(inputStr);

            dictConfEntryDict          = conf.dictConfEntryDict;
            mosesPath                  = conf.mosesPath;
            translConfEntryDict        = conf.translConfEntryDict;
            keepTrackOfFiles           = conf.keepTrackOfFiles;
            logLevel                   = conf.logLevel;
            forceEnDictInterlingua     = conf.forceEnDictInterlingua;
            forceEnTranslitInterlingua = conf.forceEnTranslitInterlingua;
            outputFormat               = conf.outputFormat;
            excDictEntryDict           = conf.excDictEntryDict;
            allowTrimmedAlignments     = conf.allowTrimmedAlignments;
            stopWordListEntryDict      = conf.stopWordListEntryDict;
            langPairEntryDict          = conf.langPairEntryDict;
            alignmentThreads           = conf.alignmentThreads;
            useMultiThreadedExecution  = conf.useMultiThreadedExecution;
            printTopTrgForSrc          = conf.printTopTrgForSrc;
            concLen = conf.concLen;
        }
Exemplo n.º 3
0
        public static PreprocessedTermData ReadFromFile(string inputFile)
        {
            string inputStr = File.ReadAllText(inputFile, Encoding.UTF8);

            return(MPFrameworkFunctions.DeserializeString <PreprocessedTermData>(inputStr));
        }