File: elixir-resolve.pl

package info (click to toggle)
libelixirfm-perl 1.1.976-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 348 kB
  • ctags: 125
  • sloc: perl: 2,260; makefile: 14
file content (96 lines) | stat: -rw-r--r-- 1,585 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#! perl -w

BEGIN {

    our $VERSION = join '.', '1.1', q $Revision: 846 $ =~ /(\d+)/;

    use Getopt::Std;

    $Getopt::Std::STANDARD_HELP_VERSION = 1;

    our $options = {};

    getopts('v', $options);

    warn $VERSION . "\n" and exit if exists $options->{'v'};
}


BEGIN {

    warn "Initializing ...\n";
}


use ElixirFM::Resolve;

use strict;

my $elixir = new ElixirFM::Resolve;


warn "ElixirFM is now expecting your input!\n\n";


while (my $line = <>) {

    my @word = split ' ', undiacritize($line);

    print $elixir->pretty($elixir->resolve($_)), "\n\n" foreach @word;
}


warn "Quitting ...\n";


sub undiacritize {

    my $text = $_[0];

    $text =~ tr[aiuo~`FNK][]d;

    return $text;
}


__END__


=head1 NAME

elixir-resolve - Arabic morphological analyzer derived from ElixirFM


=head1 REVISION

    $Revision: 846 $        $Date: 2009-04-22 22:25:47 +0200 (Wed, 22 Apr 2009) $


=head1 OPTIONS

  elixir-resolve [OPTIONS]
    -v       --version      show program's version
             --help         show usage information


=head1 SEE ALSO

ElixirFM Project                L<http://sourceforge.net/projects/elixir-fm/>

Encode Arabic Project           L<http://sourceforge.net/projects/encode-arabic/>


=head1 AUTHOR

Otakar Smrz C<< <otakar smrz mff cuni cz> >>, L<http://ufal.mff.cuni.cz/~smrz/>


=head1 COPYRIGHT AND LICENSE

Copyright (C) 2009-2005 Otakar Smrz, 2009 Viktor Bielicky, 2002 Tim Buckwalter

This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3.


=cut