views:

42

answers:

1

The problem

A friend is developing a Swedish dictionary web application. One use will be for checking words in Scrabble games. The Swedish Scrabble rules (in Swedish) allow for example 'a' and 'á' to be treated as the same letter, but not 'u' and 'û' or 'y' and 'ü'. The Swedish collation rules (latin1_swedish_ci) think differently and treat 'y' and 'ü' as the same letter, making the word 'mysli' match as a correct word although it should be spelled 'müsli'.

Three proposed solutions

Update: added a third solution proposal (in bold)

  1. Use different collations for different rows in the words table. Is that possible?
  2. Clone the Swedish collation definition, edit it and use in MySQL. Can that be done easier than the methods described here?
  3. Add a new column to the table with the special words. It is possible to have different collations on columns, right? Would the SQL query become very slow when searching for a word in both columns?

Other suggestions?

Could this be solved in some other way?

A: 

to 1.: this isn't possible

to 2.: i don't know - and i'm interested in knowing if this is possible, too.

EDIT:

to 3.: yes, thats possible - it will be a little slower but i think you won't notice it. (and if it's the only possibility, you don't have another choice)

oezi
We've been discussing if it would be a better idea to split the table into two tables, where one holds most of the words, and the other one holds the special words. I guess that's more or less just another version of 3.
Peter Jaric