Re: best method to perform operations on word lists
- From: "Bart Van der Donck" <bart@xxxxxxxxxx>
- Date: 10 Jun 2006 03:18:13 -0700
Francois Massion wrote:
Well, the issue is really a matter of pragmatism. If I do the work
manually or with some VBA macros it will take ages. The situation I am
trying to address is not so uncommon to people working on glossary
issues. Therefore I am trying to find a language-independant solution
which works, say, for 90% of the words.
If you can afford such an error margin, here is a brute approach:
#!perl
use strict; use warnings;
my $list =
"überzeugt
überzeugt,
überzogen
überzogen,
überzogen.
üblich
übliche
üblichen
üblicherweise";
my @terms = split /\n/, $list;
my $prev = 'nonesuch584685542256RANOM58544';
s/(\.|,|e|en|e,|en,|e\.|en\.)$// for @terms;
@terms = grep($_ ne $prev && ($prev = $_), sort @terms);
print $_."\n" for @terms;
FWIW,
--
Bart
.
- Follow-Ups:
- Re: best method to perform operations on word lists
- From: Francois Massion
- Re: best method to perform operations on word lists
- From: Dr.Ruud
- Re: best method to perform operations on word lists
- References:
- best method to perform operations on word lists
- From: Francois Massion
- Re: best method to perform operations on word lists
- From: Dr.Ruud
- Re: best method to perform operations on word lists
- From: Francois Massion
- Re: best method to perform operations on word lists
- From: Bart Van der Donck
- Re: best method to perform operations on word lists
- From: Francois Massion
- best method to perform operations on word lists
- Prev by Date: Re: best method to perform operations on word lists
- Next by Date: Re: Still Error when connecting to database using Win32::ODBC
- Previous by thread: Re: best method to perform operations on word lists
- Next by thread: Re: best method to perform operations on word lists
- Index(es):