public async Task fillWordBaseDetails(WordBase wb)
 {
     classes.WordBase wbout = new classes.WordBase();
     if (_WordBase.TryGetValue(wb.baseWordXml, out wbout) != false)
     {
         Task <(List <Meaning>, classes.WordForm_Overload)> tm = Implementation.LODConnector.FetchWordDetails(wb.baseWordXml);
         (wb.meanings, wb.wordForm) = await tm;
     }
 }
Esempio n. 2
0
        public void DoExport(classes.WordOverview _wo)
        {
            ExporterClassObject exporterClassObject = new ExporterClassObject();

            classes.WordBase _wb   = new WordBase();
            int    wordPointer     = _wo.WordPointer - 1;
            int    meaningPointer  = _wo._wordPossibleMeanings[wordPointer].meaningPointer - 1;
            string wordBasePointer = _wo._wordPossibleMeanings[wordPointer].wordBasePointer;

            frmMainProgram.getInstance()._articleFile.article._WordBase.TryGetValue(wordBasePointer, out _wb);
            if (_wb != null)
            {
                //Lu

                if (_wb.meanings[meaningPointer].LU != null)
                {
                    exporterClassObject.LU = _wb.meanings[meaningPointer].LU;
                }
                else
                {
                    exporterClassObject.LU = _wb.baseWordLu;
                }

                exporterClassObject.Occurence = _wo._wordPossibleMeanings[wordPointer].occurence;
                exporterClassObject.DE        = _wb.meanings[meaningPointer].DE;
                exporterClassObject.FR        = _wb.meanings[meaningPointer].FR;
                exporterClassObject.EN        = _wb.meanings[meaningPointer].EN;
                exporterClassObject.PT        = _wb.meanings[meaningPointer].PT;
                exporterClassObject.WuertForm = _wb.wordForm.WordFormStringLu;

                switch (exporterClassObject.WuertForm)
                {
                case "Verb":
                case "Hëllefsverb":
                case "Modalverb": exporterClassObject.LUs = _wb.wordForm.pastParticiple;
                    exporterClassObject.LUpretend         = _wb.wordForm.WordFormHelperVerb;
                    break;

                case "Adjektiv":
                case "Adverb":
                case "Partikel": exporterClassObject.LUs = null;
                    break;

                default:     //Default with plural
                    if (_wb.wordForm.WordFormPlurals != null && _wb.meanings[meaningPointer].NoPlural == true)
                    {
                        exporterClassObject.LUs = "(kee Pluriel)";
                    }
                    else
                    {
                        if (_wb.meanings[meaningPointer].LUs != null)
                        {
                            exporterClassObject.LUs = _wb.meanings[meaningPointer].LUs;
                        }
                        else
                        {
                            string plural = "";
                            if (_wb.wordForm.WordFormPlurals == null)
                            {
                                exporterClassObject.LUs = "(kee Pluriel)";
                            }
                            else
                            {
                                foreach (string wfp in _wb.wordForm.WordFormPlurals)
                                {
                                    plural += wfp;
                                }
                                exporterClassObject.LUs = plural;
                            }
                        }
                    }
                    break;
                }

                exporterClassObject.MP3 = _wb.baseMp3;

                if (_wo._wordPossibleMeanings[wordPointer].customMeaning != null)
                {
                    if (_wo._wordPossibleMeanings[wordPointer].customMeaning.MP3 != null)
                    {
                        exporterClassObject.MP3 = _wo._wordPossibleMeanings[wordPointer].customMeaning.MP3;
                    }

                    /*
                     *  TODO
                     */
                }

                PrepareMp3(exporterClassObject.MP3);

                wordlist.Add(exporterClassObject);
            }
            else
            {
                throw new Exception("Wuert konnt net fonnt ginn: " + wordBasePointer + "\n" + _wo.ToString());
            }
        }