示例#1
0
        public bool QueryRegex(string strQuery, out Regex re) {
            re = null;

            if(String.IsNullOrEmpty(strQuery))
                return false;

            if(this.migemoWrapper == null) {
                try {
                    this.migemoWrapper = new MigemoWrapper(MigemoLoader.pathDLL, MigemoLoader.pathDic);
                }
                catch {
                    return false;
                }
            }

            if(this.migemoWrapper != null && this.migemoWrapper.IsEnable) {
                try {
                    bool fStartWithNoPartial = strQuery.StartsWith("^");
                    if(fStartWithNoPartial && strQuery.Length > 1)
                        strQuery = strQuery.Substring(1);

                    string strPrefix = String.Empty;
                    if(fStartWithNoPartial || !MigemoLoader.fPartialMatch)
                        strPrefix = "^";

                    re = new Regex(strPrefix + this.migemoWrapper.QueryRegexStr(strQuery), RegexOptions.IgnoreCase);
                    return true;
                }
                catch {
                }
            }
            return false;
        }
示例#2
0
 public void Close(EndCode endCode)
 {
     if(migemoWrapper != null) {
         migemoWrapper.Dispose();
         migemoWrapper = null;
     }
 }
示例#3
0
 public void Close(EndCode endCode)
 {
     if (migemoWrapper != null)
     {
         migemoWrapper.Dispose();
         migemoWrapper = null;
     }
 }
示例#4
0
 public void Close(EndCode endCode)
 {
     if (this.migemoWrapper != null)
     {
         this.migemoWrapper.Dispose();
         this.migemoWrapper = null;
     }
 }
示例#5
0
        public bool QueryRegex(string strQuery, out Regex re)
        {
            re = null;

            if (String.IsNullOrEmpty(strQuery))
            {
                return(false);
            }

            if (migemoWrapper == null)
            {
                try {
                    migemoWrapper = new MigemoWrapper(pathDLL, pathDic);
                }
                catch {
                    return(false);
                }
            }

            if (migemoWrapper != null && migemoWrapper.IsEnable)
            {
                try {
                    bool fStartWithNoPartial = strQuery.StartsWith("^");
                    if (fStartWithNoPartial && strQuery.Length > 1)
                    {
                        strQuery = strQuery.Substring(1);
                    }

                    string strPrefix = String.Empty;
                    if (fStartWithNoPartial || !fPartialMatch)
                    {
                        strPrefix = "^";
                    }

                    re = new Regex(strPrefix + migemoWrapper.QueryRegexStr(strQuery), RegexOptions.IgnoreCase);
                    return(true);
                }
                catch {
                }
            }
            return(false);
        }
示例#6
0
 public void Close(EndCode endCode) {
     if(this.migemoWrapper != null) {
         this.migemoWrapper.Dispose();
         this.migemoWrapper = null;
     }
 }