Subject: [CODE4LIB] find in page, diacritics, etc

From: Tim Shearer <[email-masked]>
Date: Fri, 28 Aug 2009 12:17:58 -0400

Hi Folks,

Looking for help/perspectives.

Anyone got any clever solutions for allowing folks to find a word with 
diacritics in a rendered web page regardless of whether or not the user 
tries with or without diacritics.

In indexes this is usually solved by indexing the word with and without, 
so the user gets what they want regardless of how they search.

Thanks in advance for any ideas/enlightenment,
Tim

---

From: Joe Atzberger <[email-masked]>
Date: Fri, 28 Aug 2009 12:37:05 -0400

Something like the jquery highlight function combined with this kind of
mapping:

http://stackoverflow.com/questions/863800/replacing-diacritics-in-javascript

If you don't mind, you can speed things up by forcing the comparison sets to
be in one case or the other.
--Joe

On Fri, Aug 28, 2009 at 12:17 PM, Tim Shearer <[email-masked]> wrote:

> In indexes this is usually solved by indexing the word with and without, so
> the user gets what they want regardless of how they search.
>

---

From: Keith Jenkins <[email-masked]>
Date: Fri, 28 Aug 2009 12:49:32 -0400

Hi, Tim.

Are you are referring to a "find in page", where a user presses CTRL-F
in the browser?

If so, it will depend on the browser.  Google Chrome 2.0 will find
matches regardless of the diacritics (i.e. user can type "placa" and
it matches "plaça", and vice versa).  This doesn't seem to work in
Firefox 3.0.13 or IE8.

Keith

---

From: Tim Shearer <[email-masked]>
Date: Fri, 28 Aug 2009 13:08:21 -0400

> Are you are referring to a "find in page", where a user presses CTRL-F

Yes, sorry to be unclear.

> it matches "plaça", and vice versa).  This doesn't seem to work in

Exactly, and FF and IE are the most common browsers we're seeing.

I was wondering if someone (I know this sounds crazy) has explored the 
idea of marking up the non-diacritic inline version of the word in a span 
styled in such a way as to make it findable but not intrusive.

-t

---

From: Ken Irwin <[email-masked]>
Date: Fri, 28 Aug 2009 13:32:38 -0400

This sounds like a great idea for a Firefox plugin...

Ken

> -----Original Message-----
> From: Code for Libraries [mailto:[email-masked]] On Behalf Of
> Tim Shearer
> Sent: Friday, August 28, 2009 12:18 PM
> To: [email-masked]
> Subject: [CODE4LIB] find in page, diacritics, etc
> 
> Hi Folks,
>

---

From: Joe Hourcle <[email-masked]>
Date: Fri, 28 Aug 2009 13:40:23 -0400

> it matches "plaça", and vice versa).  This doesn't seem to work in

Works in Safari 4.0.3, fails in Firefox 3.5.2

Here's a page to test with, using the correct (non-americanized) spelling 
of my name:

 	http://www.frbr.org/2009/01/15/hourcle-frbr-applied-to-scientific-data

As for tricks to get it to work -- T\the closest HTML tag that I can think 
of is 'ABBR' which isn't quite right:

 	<ABBR lang='fr' title='Hourcle'>Hourcl&eacute;</ABBR>

... and a quick test in Firefox 3.5 shows it doesn't help.

-Joe

(and no, it's not French, but it's a French spelling, so it'd clue the 
pronunciation for screen readers correctly