Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Ignoring of a regex pattern issue - RapidSpell Web ASP.NET - Forum

Welcome Guest Search | Active Topics | Log In | Register

#1 Posted : Tuesday, November 21, 2017 9:17:41 AM
Rank: Member

Groups: Registered

Joined: 11/21/2017
Posts: 16
Location: Ukraine
Hi all,

Hope you will be able to help me.

As a precondition I have the following string to validate:

"My favourite book is [some boooook]"

The validator shows me an error what is true. There is a requirement to ignore any text in square brackets so in the case above I should not have any issues.

I am using Keyoti.RapidSpell.RapidSpellChecker instance, AddIgnorePattern() method

with the following regular expression:


which works in anoter regex tester.

After that I am running Check() method that is still finding the text in square brackets.

I was wondering if someone could help me to understand what I did wrong.

Looking forward to any reply.

I have even tried to disable all ignore flags on the RapidSpellChecker class as follows thinking of possible excluding square brackets, but the issue keeps appearing.

checker.IgnoreXML = false;
checker.IgnoreWordsWithDigits = false;
checker.IgnoreURLsAndEmailAddresses = false;
checker.IgnoreInEnglishLowerCaseI = false;
checker.IgnoreRtfCodes = false;
#2 Posted : Tuesday, November 21, 2017 4:54:42 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,630
Location: Canada
Hi, it's not working the way you want because the first thing the spell checker does is split the text into 'words'. Then as it looks at each 'word' it applies the regex to see what will be ignored.

I'm not sure of the context of what you're doing (how you're using 'checker') but you could possibly replace all matches of [....] with spaces in your text, and then spell check that?

It is possible to subclass the RapidSpellChecker and AdvancedTextBoundary classes to change the behaviour but for you I think the above is simplest. Although superficially https://keyoti.com/kb/De...uestId=147&catId=62 looks similar to what you want, it isn't because it still won't work across multiple words.
-your feedback is helpful to other users, thank you!

#3 Posted : Wednesday, February 7, 2018 10:28:45 AM
Rank: Guest


Message was deleted by Moderator.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.