示例#1
0
        public static void SetItemInLexRecord(LexRecord lexRecord, int contentType, string item)
        {
            switch (contentType)

            {
                case 1:
                    lexRecord.SetBase(item);
                    break;
            }
        }
示例#2
0
        private static bool CheckOrder(LexRecord lexRecord)

        {
            bool validFlag   = true;
            int  contentType = 1;

            string        citation = lexRecord.GetBase();
            List <string> spVars   = lexRecord.GetSpellingVars();
            List <string> bases    = new List <string>();

            bases.Add(citation);
            foreach (string spVar in spVars)

            {
                bases.Add(spVar);
            }

            BaseComparator <string> bc = new BaseComparator <string>();

            bases.Sort(bc);

            if (!citation.Equals(bases[0]))

            {
                lexRecord.SetBase((string)bases[0]);
                validFlag = false;
            }

            bases.RemoveAt(0);
            lexRecord.SetSpellingVars(bases);

            if (!validFlag)

            {
                ErrMsgUtilLexRecord.AddContentErrMsg(contentType, 6, citation, lexRecord);
            }

            return(validFlag);
        }
示例#3
0
        private static void GetLexRecord(Node node, LexRecord lexRecord, CatEntry catEntry)


        {
            if (node.NodeType == XmlNodeType.Element)

            {
                if (node.Name.Equals("base"))

                {
                    lexRecord.SetBase(getValue(node));
                }
                else if (node.Name.Equals("eui"))

                {
                    lexRecord.SetEui(getValue(node));
                }
                else if (node.Name.Equals("cat"))
                {
                    lexRecord.SetCat(getValue(node));
                }
                else if (node.Name.Equals("spellingVars"))

                {
                    lexRecord.SetSpellingVar(getValue(node));
                }
                else if (node.Name.Equals("acronyms"))

                {
                    lexRecord.GetAcronyms().Add(getValue(node));
                }
                else if (node.Name.Equals("abbreviations"))

                {
                    lexRecord.GetAbbreviations().Add(getValue(node));
                }
                else if (node.Name.Equals("annotations"))

                {
                    lexRecord.GetAnnotations().Add(getValue(node));
                }
                else if (node.Name.Equals("signature"))

                {
                    lexRecord.SetSignature(getValue(node));
                }
                else if (node.Name.Equals("verbEntry"))

                {
                    catEntry = getVerbValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
                else if (node.Name.Equals("auxEntry"))

                {
                    catEntry = getAuxValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
                else if (node.Name.Equals("modalEntry"))

                {
                    catEntry = getModalValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
                else if (node.Name.Equals("nounEntry"))

                {
                    catEntry = getNounValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
                else if (node.Name.Equals("pronEntry"))

                {
                    catEntry = getPronValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
                else if (node.Name.Equals("adjEntry"))

                {
                    catEntry = getAdjValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
                else if (node.Name.Equals("advEntry"))

                {
                    catEntry = getAdvValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
                else if (node.Name.Equals("detEntry"))

                {
                    catEntry = getDetValues(node);
                    lexRecord.SetCatEntry(catEntry);
                }
            }

            for (Node child = node.FirstChild; child != null; child = child.NextSibling)


            {
                GetLexRecord(child, lexRecord, catEntry);
            }
        }