/** * Recursively register a {@link BetterLinkMovementMethod} on every TextView inside a layout. * * @param linkifyMask One of {@link Linkify#ALL}, {@link Linkify#PHONE_NUMBERS}, {@link Linkify#MAP_ADDRESSES}, * {@link Linkify#WEB_URLS} and {@link Linkify#EMAIL_ADDRESSES}. * @return The registered {@link BetterLinkMovementMethod} on the TextViews. */ public static BetterLinkMovementMethod Linkify(MatchOptions linkifyMask, Activity activity) { // Find the layout passed to setContentView(). var activityLayout = (ViewGroup)((ViewGroup)activity.FindViewById(Window.IdAndroidContent)).GetChildAt(0); var movementMethod = NewInstance(); RAddLinks(linkifyMask, activityLayout, movementMethod); return(movementMethod); }
public PanGuTokenizer(AttributeFactory factory, TextReader input, MatchOptions options, MatchParameter parameters) : base(factory, input) { lock (_LockObj) { Init(); } this._options = options; this._parameters = parameters; }
/** * @param linkifyMask One of {@link Linkify#ALL}, {@link Linkify#PHONE_NUMBERS}, {@link Linkify#MAP_ADDRESSES}, * {@link Linkify#WEB_URLS} and {@link Linkify#EMAIL_ADDRESSES}. * @param textViews The TextViews on which a {@link BetterLinkMovementMethod} should be registered. * @return The registered {@link BetterLinkMovementMethod} on the TextViews. */ public static BetterLinkMovementMethod Linkify(MatchOptions linkifyMask, params TextView[] textViews) { var movementMethod = NewInstance(); foreach (var textView in textViews) { AddLinks(linkifyMask, movementMethod, textView); } return(movementMethod); }
/// <summary> /// 通过分词将内容拆分 /// </summary> /// <param name="content"></param> /// <returns></returns> public virtual IEnumerable <string> GetWordList(string content) { //TODO 将分词结果缓存起来 var matchOptions = new MatchOptions(); matchOptions.FrequencyFirst = true; Segment segment = new Segment(); var words = segment.DoSegment(content, matchOptions).Select(word => word.Word); return(words); }
/// <summary> /// Sets the active filters. /// </summary> private void SetActiveFilters() { foreach (ListItem item in chkListFilters.Items) { DuplicateProvider.SetActiveFilter(item.Value, item.Selected); } DuplicateProvider.MatchOperator = rdgOptions.SelectedIndex == 0 ? MatchOperator.And : MatchOperator.Or; DuplicateProvider.SearchAccount = chkAccounts.Checked; DuplicateProvider.SearchContact = (chkContacts.Checked); DuplicateProvider.SearchLead = (chkLeads.Checked); DuplicateProvider.AdvancedOptions = MatchOptions.GetAdvancedOptions(); }
private static MatchOptions Settings() { MatchOptions Options = new MatchOptions(); Options.MatchYati = true; Options.MatchPrasa = true; Options.AllowSantiPrasa = true; Options.QuickMatch = true; Options.ExperimenatalSandhi = true; Options.Language = RuleLanguage.Telugu; return(Options); }
private void BuildOptions() { Options = new MatchOptions(); Options.IncludeRare = true; Options.Language = RuleLanguage.Telugu; Options.AllowSantiPrasa = Fetch("SantiPrasa", "1"); Options.ExperimenatalSandhi = Fetch("SoundexSandhi", "1"); Options.MatchPrasa = Fetch("MatchPrasa", "1"); Options.MatchYati = Fetch("MatchYati", "1"); Options.QuickMatch = Fetch("QuickMatch", "1"); }
public bool Match(QueueIdentity matchPattern, MatchOptions matchOptions) { if (!PagedObjectSchema.MatchString(this.NextHopDomain, matchPattern.nextHopDomain, matchOptions)) { return(false); } if (string.IsNullOrEmpty(this.server)) { throw new InvalidOperationException(); } return(string.IsNullOrEmpty(matchPattern.server) || this.server.Equals(matchPattern.server, StringComparison.OrdinalIgnoreCase)); }
private static MatchOptions Settings() { MatchOptions Options = new MatchOptions(); Options.MatchYati = Util.IsChecked("btnYatiCheck"); Options.MatchPrasa = Util.IsChecked("btnYatiCheck"); Options.AllowSantiPrasa = Util.IsChecked("allowSantiPrasa"); Options.QuickMatch = Util.IsChecked("quickMatch"); Options.ExperimenatalSandhi = Util.IsChecked("experimentalYati"); Options.Language = Context.Language; SaveOptions(Options); return(Options); }
// Token: 0x0600228A RID: 8842 RVA: 0x000C58FC File Offset: 0x000C3AFC private static QueryFilter BuildTextFilter(string keyWord, MatchOptions matchOptions, params PropertyDefinition[] searchProperties) { QueryFilter[] array = new TextFilter[searchProperties.Length]; for (int i = 0; i < searchProperties.Length; i++) { array[i] = new TextFilter(searchProperties[i], keyWord, matchOptions, MatchFlags.IgnoreCase); } if (array.Length <= 1) { return(array[0]); } return(new OrFilter(array)); }
private void Identifier(string s) { MatchOptions Options = MatchOptions.QucikMatchSettings; Options.Language = RuleLanguage.Kannada; Options.MatchYati = false; Options.MatchPrasa = true; Probable Pr = Padyam.MostProbable(s, Options); MatchResult MR = Pr.MatchResult; Console.Write(MR.Percentage); }
public static string Build(Poem Poem, MatchOptions Options, OutputOptions OO) { if (Poem == null) { return(""); } if (Poem.Text.Trim().Length == 0) { return(""); } List <Rule> Rules = new List <Rule>(); if (OO.Rules == null || OO.Rules.Count == 0) { if (Poem.Identifier == null) { Rules.AddRange(Manager.Rules()); } else { Rule R2 = Manager.FetchRule(Poem.Identifier); if (R2 == null) { Rules.AddRange(Manager.Rules()); } else { Rules.Add(R2); } } } else { Rules.AddRange(OO.Rules); } Probable Pr = Padyam.MostProbable2(Poem.Text, Options, Rules); if (Pr.MatchResult == null) { Debugger.Break(); } MatchResult MR = Pr.MatchResult; Rule R = Pr.Rule; Padyam P = Pr.Padyam; return(Build(MR, R, P, OO)); }
private static void SaveOptions(MatchOptions Options) { try { int days = 30; CookieUtil.SetCookie("y", Options.MatchYati ? "1" : "0", days); CookieUtil.SetCookie("p", Options.MatchPrasa ? "1" : "0", days); CookieUtil.SetCookie("sp", Options.AllowSantiPrasa ? "1" : "0", days); CookieUtil.SetCookie("qm", Options.QuickMatch ? "1" : "0", days); CookieUtil.SetCookie("es", Options.ExperimenatalSandhi ? "1" : "0", days); } catch { } }
public void OptionalMatchEntity() { var person = SampleDataFactory.GetWellKnownPerson(7); var q = GetFluentQuery() .MatchEntity(person) .OptionalMatchEntity(person.HomeAddress, MatchOptions.Create("ha").WithNoProperties()); var text = q.GetFormattedDebugText(); Console.WriteLine(text); Assert.AreEqual(@"MATCH (person:SecretAgent {Id:{ Id: 7 }.Id}) OPTIONAL MATCH (ha:Address)", text); }
private static void SetOptions(MatchOptions Options) { try { Util.SetCheckedValue("btnYatiCheck", Options.MatchYati); Util.SetCheckedValue("btnYatiCheck", Options.MatchPrasa); Util.SetCheckedValue("allowSantiPrasa", Options.AllowSantiPrasa); Util.SetCheckedValue("quickMatch", Options.QuickMatch); Util.SetCheckedValue("experimentalYati", Options.ExperimenatalSandhi); } catch { } }
public static void OnTryMatch2(Rule R) { Window.Document.GetElementById("result").InnerHTML = "<b style='color:red;'>Matching..</b>"; Script.SetTimeout(delegate() { StopWatch.Start(); MatchOptions Options = Settings(); string s = Business.TryMatch2(Util.GetValue("txt"), R, Options); Window.Document.GetElementById("result").InnerHTML = s; Util.ScrollTo("main"); StopWatch.ShowTicks(true); Metrics.Export2(Metric.TryMatch2, StopWatch.LastTicks, s); }, 0); }
private void OnCreateMatchClicked() { MatchOptions options = new MatchOptions(); options.Name = this.prefabs.MatchName.text; options.Rounds = string.IsNullOrWhiteSpace(this.prefabs.RoundCount.text) == false?int.Parse(this.prefabs.RoundCount.text) : 5; options.Style = (this.prefabs.AllCardsToggle.isOn) ? MatchStyle.AllCards : MatchStyle.Rounds; options.TimerLength = string.IsNullOrWhiteSpace(this.prefabs.TimerLength.text) == false?float.Parse(this.prefabs.TimerLength.text) : 10f; if (string.IsNullOrWhiteSpace(options.Name)) { options.Name = "Match"; } this.tempJoinName = options.Name; Controller.CreateMatch(options); }
// ======== PUBLIC APIs END ======== // private static void RAddLinks(MatchOptions linkifyMask, ViewGroup viewGroup, BetterLinkMovementMethod movementMethod) { for (var i = 0; i < viewGroup.ChildCount; i++) { var child = viewGroup.GetChildAt(i); if (child is ViewGroup) { // Recursively find child TextViews. RAddLinks(linkifyMask, child as ViewGroup, movementMethod); } else if (child is TextView) { var textView = child as TextView; AddLinks(linkifyMask, movementMethod, textView); } } }
public static Chandam.Core.MatchOptions MapOptions(MatchOptions2 Options2) { if (Options2 == null) { return(null); } MatchOptions Options = new MatchOptions(); Options.AllowSantiPrasa = IfNotNull(Options2.AllowSantiPrasa); Options.ExperimenatalSandhi = IfNotNull(Options2.ExperimenatalSandhi); Options.IncludeRare = IfNotNull(Options2.IncludeRare); Options.Language = (Options2.Language == null) ? RuleLanguage.Telugu : (Options2.Language); Options.MatchPrasa = IfNotNull(Options2.MatchPrasa); Options.MatchYati = IfNotNull(Options2.MatchYati); Options.QuickMatch = IfNotNull(Options2.QuickMatch); return(Options); }
public PanGuTokenizer(System.IO.TextReader input, MatchOptions options, MatchParameter parameters) : base(input) { lock (_LockObj) { Init(); } _InputText = base.input.ReadToEnd(); if (string.IsNullOrEmpty(_InputText)) { char[] readBuf = new char[1024]; int relCount = base.input.Read(readBuf, 0, readBuf.Length); StringBuilder inputStr = new StringBuilder(readBuf.Length); while (relCount > 0) { inputStr.Append(readBuf, 0, relCount); relCount = input.Read(readBuf, 0, readBuf.Length); } if (inputStr.Length > 0) { _InputText = inputStr.ToString(); } } if (string.IsNullOrEmpty(_InputText)) { _WordList = new WordInfo[0]; } else { global::PanGu.Segment segment = new Segment(); ICollection <WordInfo> wordInfos = segment.DoSegment(_InputText, options, parameters); _WordList = new WordInfo[wordInfos.Count]; wordInfos.CopyTo(_WordList, 0); } }
public static string MatchOptionToString(MatchOptions mo) { if (mo == MatchOptions.And) { return("and"); } else if (mo == MatchOptions.Or) { return("or"); } else if (mo == MatchOptions.Both) { return("both"); } else { return("undefined"); } }
public static void OnScores() { Window.Document.GetElementById("result").InnerHTML = "<b style='color:red;'>Determining Scores..</b>"; Script.SetTimeout(delegate() { StopWatch.Start(); MatchOptions Options = Settings(); string s = Business.Scores(Util.GetValue("txt"), Options); Window.Document.GetElementById("result").InnerHTML = s; Script.Literal("var s1=new SortableTable(document.getElementById('scores'),['Number','String','String', 'Number', 'Number', 'Number']);s1.sort(3,true);"); StopWatch.ShowTicks(true); Metrics.Export2(Metric.Scores, StopWatch.LastTicks); }, 0); }
static void Analysis() { Segment.Init(); var text = "山东省 济宁市 , 你好李小龙成龙, 15166793828, 277606"; var options = new MatchOptions { ChineseNameIdentify = true, OnlyChineseName = true, }; var parameters = new MatchParameter { }; Segment segment = new Segment(); ICollection <WordInfo> words = segment.DoSegment(text, options, parameters); foreach (var word in words) { Console.WriteLine(word + "-" + word.WordClass.ToString()); } Console.ReadKey(); }
public static MatchError ComputeMouthDentError( DatabaseFin unknownFin, DatabaseFin databaseFin, MatchOptions options) { if (unknownFin == null) { throw new ArgumentNullException(nameof(unknownFin)); } if (databaseFin == null) { throw new ArgumentNullException(nameof(databaseFin)); } var maxError = new MatchError { Error = 1 }; if (databaseFin.FinOutline?.FeatureSet?.Features.ContainsKey(Features.FeatureType.HasMouthDent) != true || unknownFin.FinOutline?.FeatureSet?.Features.ContainsKey(Features.FeatureType.BrowCurvature) != true) { return(maxError); } var unknownHasMouthDent = unknownFin.FinOutline?.FeatureSet?.Features[Features.FeatureType.HasMouthDent].Value; var databaseHasMouthDent = databaseFin.FinOutline?.FeatureSet?.Features[Features.FeatureType.HasMouthDent].Value; if (unknownHasMouthDent == null || databaseHasMouthDent == null) { return(maxError); } return(new MatchError { Error = Math.Abs(unknownHasMouthDent.Value - databaseHasMouthDent.Value) }); }
protected ContentFlags GetContentFlags(MatchFlags matchFlags, MatchOptions matchOptions) { ContentFlags contentFlags; switch (matchOptions) { case MatchOptions.SubString: contentFlags = ContentFlags.SubString; goto IL_34; case MatchOptions.Prefix: contentFlags = ContentFlags.Prefix; goto IL_34; case MatchOptions.PrefixOnWords: contentFlags = ContentFlags.PrefixOnWords; goto IL_34; case MatchOptions.ExactPhrase: contentFlags = ContentFlags.ExactPhrase; goto IL_34; } contentFlags = ContentFlags.FullString; IL_34: if ((matchFlags & MatchFlags.IgnoreCase) != MatchFlags.Default) { contentFlags |= ContentFlags.IgnoreCase; } if ((matchFlags & MatchFlags.IgnoreNonSpace) != MatchFlags.Default) { contentFlags |= ContentFlags.IgnoreNonSpace; } if ((matchFlags & MatchFlags.Loose) != MatchFlags.Default) { contentFlags |= ContentFlags.Loose; } return(contentFlags); }
private void Search() { string query = searchInput.Text; if (allowEmptySearchCheckbox.IsChecked == false && query.Length < 1) { return; } var options = new MatchOptions { IgnoreCase = ignoreCaseCheckbox.IsChecked == true, NearCharacterRecognition = nearMatchCheckbox.IsChecked == true, QueryIsRegex = regexCheckbox.IsChecked == true }; var playersMatched = splatTagController.MatchPlayer(query, options); var teamsMatched = splatTagController.MatchTeam(query, options); Title = titleLead + $"Matched {playersMatched.Length} players and {teamsMatched.Length} teams!"; playersListBox.ItemsSource = playersMatched; teamsListBox.ItemsSource = teamsMatched; }
public bool MediaReplace(Request r, MatchOptions filePathMatching) { bool andResult = false; bool orResult = false; if (mEngine == MatchEngine.Filters) { andResult = SearchFilter("and", "inject_media_and", r.target); orResult = SearchFilter("or", "inject_media_or", r.target); } else if (mEngine == MatchEngine.RegEx) { andResult = MatchRegex("and", "inject_media_and", r.target); orResult = MatchRegex("or", "inject_media_or", r.target); } else { return(false); } if (filePathMatching == MatchOptions.Both && andResult && orResult) { return(true); } else if (filePathMatching == MatchOptions.And && andResult) { return(true); } else if (filePathMatching == MatchOptions.Or && orResult) { return(true); } else { return(false); } }
public override void Visit(StringNode node) { PropertyKeyword key; if (!this.TryGetCurrentPropertyKeyword(out key)) { this.isQueryFilterValid = false; return; } string text = node.Text; MatchOptions options = MatchOptions.FullString; if (node.Mode == null) { options = MatchOptions.ExactPhrase; } else if (node.Wildcard || (this.parseOptions & KqlParser.ParseOption.DisablePrefixMatch) == KqlParser.ParseOption.None) { text = text.TrimEnd(new char[] { '*' }); int num; if ((this.parseOptions & KqlParser.ParseOption.AllowShortWildcards) != KqlParser.ParseOption.None || (text.Length > 1 && (text.Length > 4 || !int.TryParse(text, NumberStyles.Integer, this.culture, out num)))) { options = (((this.parseOptions & KqlParser.ParseOption.ContentIndexingDisabled) == KqlParser.ParseOption.None) ? MatchOptions.PrefixOnWords : MatchOptions.SubString); } } QueryFilter queryFilter = QueryFilterBuilder.stringNodeBuilderMap[key](this, Globals.PropertyKeywordToDefinitionMap[key], text, options); if (queryFilter != null) { this.CurrentLevelFilters.Add(queryFilter); return; } this.isQueryFilterValid = false; }
internal static bool MatchString(string sourceText, string matchText, MatchOptions matchOptions) { if (sourceText == null) { sourceText = string.Empty; } switch (matchOptions) { case MatchOptions.FullString: return(sourceText.Equals(matchText, StringComparison.OrdinalIgnoreCase)); case MatchOptions.SubString: return(sourceText.IndexOf(matchText, StringComparison.OrdinalIgnoreCase) != -1); case MatchOptions.Prefix: return(sourceText.StartsWith(matchText, StringComparison.OrdinalIgnoreCase)); case MatchOptions.Suffix: return(sourceText.EndsWith(matchText, StringComparison.OrdinalIgnoreCase)); default: throw new InvalidOperationException(); } }
private static MatchOptions RedOptions() { try { MatchOptions Options = new MatchOptions(); //Options.QuickMatch = CookieUtil.GetCookie("qm") == "1" ? true : false; //Options.MatchYati = CookieUtil.GetCookie("y") == "1" ? true : false; //Options.MatchPrasa = CookieUtil.GetCookie("p") == "1" ? true : false; Options.AllowSantiPrasa = CookieUtil.GetCookie("sp") == "1" ? true : false; Options.ExperimenatalSandhi = CookieUtil.GetCookie("es") == "1" ? true : false; Options.MatchYati = true; Options.MatchPrasa = true; Options.QuickMatch = true; return(Options); } catch { } return(null); }
private MatchOptions settings; // Referance to level options which get passed to next scene #endregion Fields #region Methods // Use this for initialization void Start() { controller = GetComponent<XboxControls>(); settings = GameObject.FindGameObjectWithTag("Settings").GetComponent<MatchOptions>(); controller.controllerInUse = settings.playerCount - 1; }
void Start() { settings = GameObject.FindGameObjectWithTag("Settings").GetComponent<MatchOptions>(); }