]>
Commit | Line | Data |
---|---|---|
e2219f2f | 1 | # |
2 | # Conditional build: | |
db0fd4cd | 3 | %bcond_without tests # do not perform "make test" |
cac09246 | 4 | # |
e2219f2f | 5 | %include /usr/lib/rpm/macros.perl |
e6563bde | 6 | %define pdir String |
7 | %define pnam Trigram | |
cac09246 | 8 | Summary: String::Trigram - find similar strings by trigram method |
3536ac76 | 9 | Summary(pl.UTF-8): String::Trigram - poszukiwanie podobnych łańcuchów metodą trygramów |
e2219f2f | 10 | Name: perl-String-Trigram |
4b140aab | 11 | Version: 0.11 |
e2c090fe | 12 | Release: 11 |
cac09246 | 13 | Epoch: 1 |
c075ab5d | 14 | # same as perl |
15 | License: GPL v1+ or Artistic | |
e2219f2f | 16 | Group: Development/Languages/Perl |
686c97d4 | 17 | Source0: http://www.cpan.org/modules/by-module/String/%{pdir}-%{pnam}-%{version}.tar.gz |
4b140aab | 18 | # Source0-md5: 43e5234ecfb00ab06f5f07f45043b6dc |
686c97d4 | 19 | URL: http://search.cpan.org/dist/String-Trigram/ |
d8e322a3 | 20 | BuildRequires: perl-devel >= 1:5.8.0 |
13c3223c | 21 | BuildRequires: rpm-perlprov >= 4.1-13 |
e2219f2f | 22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
23 | ||
24 | %description | |
7b330706 JB |
25 | This module computes the similarity of two strings based on the |
26 | trigram method. This consists in splitting some string into triples of | |
27 | characters and comparing those to the trigrams of some other string. | |
28 | For example the string kangaroo has the trigrams {kan ang nga gar aro | |
29 | roo}. A wrongly typed kanagaroo has the trigrams {kan ana nag aga gar | |
30 | aro roo}. To compute the similarity we (roughly) divide the number of | |
31 | matching trigrams (tokens not types) by the number of all trigrams | |
32 | (types not tokens). For our example this means dividing 4 / 9 | |
33 | resulting in 0.44. | |
34 | ||
e99afcc2 JR |
35 | %description -l pl.UTF-8 |
36 | Ten moduł oblicza podobieństwo dwóch łańcuchów bazując na metodzie | |
37 | trygramów. Składa się ona z dzielenia łańcucha na trójki znaków i | |
38 | porównywanie tych trygramów z jakimś innym łańcuchem. Na przykład | |
39 | łańcuch "kangaroo" zawiera trygramy {kan ang nga gar aro roo}. Źle | |
7b330706 | 40 | napisane "kanagaroo" zawiera trygramy {kan ana nag aga gar aro roo}. |
e99afcc2 JR |
41 | Aby obliczyć podobieństwo, dzielimy (zgrubnie) liczbę pasujących |
42 | trygramów (tokenów, nie typów) przez liczbę wszystkich trygramów | |
43 | (typów, nie tokenów). W naszym przykładzie oznacza to dzielenie 4 / 9, | |
44 | co daje wartość 0.44. | |
e2219f2f | 45 | |
46 | %prep | |
47 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
48 | ||
49 | %build | |
13c3223c | 50 | %{__perl} Makefile.PL \ |
b4cbd8fd | 51 | INSTALLDIRS=vendor |
cac09246 | 52 | %{__make} \ |
a6dc13e5 | 53 | CC="%{__cc}" \ |
cac09246 | 54 | OPTIMIZE="%{rpmcflags}" |
7b330706 | 55 | |
db0fd4cd | 56 | %{?with_tests:%{__make} test} |
e2219f2f | 57 | |
58 | %install | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
db0fd4cd | 61 | %{__make} install \ |
62 | DESTDIR=$RPM_BUILD_ROOT | |
e2219f2f | 63 | |
64 | %clean | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | ||
67 | %files | |
68 | %defattr(644,root,root,755) | |
cac09246 JB |
69 | %{perl_vendorarch}/String/*.pm |
70 | %dir %{perl_vendorarch}/auto/String/Trigram | |
cac09246 | 71 | %attr(755,root,root) %{perl_vendorarch}/auto/String/Trigram/*.so |
e2219f2f | 72 | %{_mandir}/man3/* |