package flo::IndexedTable;
use lib::sql::IndexedTable;
use lib::util::Text2Html;
use lib::util::Unaccent;
use strict;

use vars qw /@ISA/;
@ISA = qw /lib::sql::IndexedTable/;


sub _data_split
{
    my $self  = shift;
    my $value = shift;

    # convert all the HTML to text first.
    $value = html2text ($value);    
    
    # Unaccent everything.
    $value = lib::util::Unaccent->process ($value);
    
    # uppercase every char.
    $value = uc $value;
    
    # turn all wierd char into nothing (accents, commas,...).
    $value =~ s/[^A-Z ]/ /gs;

#    Doesn't seem to be doing anything, bruno 2001-08-02
#    open FP, ">/tmp/foofoo";
#    print FP $value;
#    close FP;

    my @value = split /\s+/, $value;
    my %res;
    foreach my $value (@value)
    {
	$res{$value} = 1;
	# seems that people like vowels after all, jean-michel 2001-09-13
	# my $previous = $value;
	# $value =~ tr/AEIOU//d;
	# if ($value eq "" or length ($value) < 3) { $res{$previous} = 1 }
	# else                                     { $res{$value}    = 1 }
    }
    return keys %res;
}


1;
