public static List<string> GetListFromLexRecord(LexRecord lexRecord, int contentType) { List<string> outList = new List<string>(); switch (contentType) { case 2: outList = lexRecord.GetSpellingVars(); break; case 5: outList = lexRecord.GetVariants(); break; case 6: outList = lexRecord.GetNominalizations(); break; case 7: outList = lexRecord.GetAbbreviations(); break; case 8: outList = lexRecord.GetAcronyms(); break; } return outList; }
public static void SetItemInListInLexRecordAt(LexRecord lexRecord, int contentType, string item, int index) { switch (contentType) { case 2: lexRecord.GetSpellingVars()[index] = item; break; case 5: lexRecord.GetVariants()[index] = item; break; case 6: lexRecord.GetNominalizations()[index] = item; break; case 7: lexRecord.GetAbbreviations()[index] = item; break; case 8: lexRecord.GetAcronyms()[index] = item; break; } }
private static bool CheckIrreg(LexRecord lexRecord, HashSet <string> irregExpEuiList) { bool validFlag = true; List <string> variants = lexRecord.GetVariants(); string citation = lexRecord.GetBase(); List <string> svList = lexRecord.GetSpellingVars(); HashSet <string> baseList = new HashSet <string>(svList); baseList.Add(citation); HashSet <string> irregBases = new HashSet <string>(); string variant; for (System.Collections.IEnumerator localIterator = variants.GetEnumerator(); localIterator.MoveNext();) { variant = (string)localIterator.Current; if ((variant.StartsWith("irreg|")) || (variant.StartsWith("group(irreg|"))) { string irregBase = GetIrregBase(variant); if (!baseList.Contains(irregBase)) { validFlag = false; ErrMsgUtilLexRecord.AddContentErrMsg(5, 8, variant, lexRecord); } else { irregBases.Add(irregBase); } } } if (!validFlag) { return(validFlag); } if (irregBases.Count > 0) { string eui = lexRecord.GetEui(); if ((baseList.Count != irregBases.Count) && (!irregExpEuiList.Contains(eui))) { validFlag = false; foreach (string @base in baseList) { if (!irregBases.Contains(@base)) { ErrMsgUtilLexRecord.AddContentErrMsg(5, 9, @base, lexRecord); } } } } return(validFlag); }