public override StandardStruct GetStandard(string fullname)
        {
            fullname = TextProcessor.ReplaceUnderlineCharBySpaceCharacter(fullname);
            Regex regex = new Regex(this.rule);
            Match match = regex.Match(fullname);

            if (match.Success)
            {
                string mark   = match.Groups[1].Value;
                string number = match.Groups[2].Value;
                int    year   = Int32.Parse(match.Groups[3].Value);
                string name   = regex.Replace(fullname, String.Empty).Trim();

                DataVerification.CheckYear(year);

                UicStandardStruct standardInfo = new UicStandardStruct(mark, number, year, name);

                return(standardInfo);
            }

            return(null);
        }
示例#2
0
        public override StandardStruct GetStandard(string fullname)
        {
            fullname = TextProcessor.ReplaceUnderlineCharBySpaceCharacter(fullname);
            Regex regex = new Regex(base.Rule);
            Match match = regex.Match(fullname);

            if (match.Success)
            {
                string prefix = match.Groups[1].Value;

                string type;
                string markString = match.Groups[2].Value.Trim().ToUpper();
                if (markString.Length > 0 && markString.Last() == 'T')
                {
                    type = "/T";
                }
                else if (markString.Length > 0 && markString.Last() == 'Z')
                {
                    type = "/Z";
                }
                else
                {
                    type = String.Empty;
                }

                string code = match.Groups[3].Value;
                int    year = Int32.Parse(match.Groups[4].Value);
                string name = regex.Replace(fullname, String.Empty).Trim();

                DataVerification.CheckYear(year);

                ChinaStandardStruct standardInfo = new ChinaStandardStruct(prefix, type, code, year, name);

                return(standardInfo);
            }

            return(null);
        }