I have two columns in a database, let's call them STRING and NORMALIZED_STRING. The characters in STRING are processed by some to me unknown algorithm, to become the characters in the normalized form.
A character can consist of one or more bytes.
A character can be changed in one of several ways:
1. it can simply be deleted
2. a multi byte character can be mapped to a single byte character
3. a single byte character can be mapped to a multibyte character
an example.
STRING NORMALIZED_STRING
------ -----------------
ABCÅD ABCD
ABCÄD ABCëëD
ABCááD ABCèD
What I want to do is to be able to recreate the same kind of normalization myself.
Now, of course I could go through the thousands of rows manually and try to find out how it works.
But I am hoping it could be possible to let Perl do the analyzing and by comparing the strings come up with some mapping scheme:
'Å' => '',
'Ä' => 'ëë',
'áá' => 'è'
I would be very happy if this was possible!
Thanks in advance for your insights,
/L
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.