xsl-list
[Top] [All Lists]

Re: [xsl] Does 'Lecœur' occur in $text? Do you have a multi-factor XPath solution?

2013-01-19 02:06:52
If the "slighly misspelled" is due to writing after hearing,
something like the Soundex algorithm is one possible solution.
The algorithm depends on the speaker's language. There
are a few variants for English. Other languages might be
found on the internet.
-W

On 18/01/2013, Costello, Roger L. <costello(_at_)mitre(_dot_)org> wrote:
Hi Folks,

I want to determine if 'Lecœur' occurs in $text.

A naïve solution is this XPath expression:

      contains($text, 'Lecœur')

However, that does not take into account many important factors:

1. Perhaps 'Lecœur' occurs, but in $text it is in uppercase

2. Perhaps instead of the 'œ' ligature, $text uses 'oe'

3. Perhaps in $text 'Lecœur' is split over two lines and thus is hyphenated

4. Perhaps 'Lecœur' is slightly misspelled in $text and therefore requires
fuzzy matching

And there are many other important factors.

Do you have an XPath solution to this problem that takes into account the
many important factors?

/Roger

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--