# # - Lingua::EN::Squeeze - # This spec file was automatically generated by cpan2rpm [ver: 2.028] # The following arguments were used: # --keep-pipes Lingua::EN::Squeeze 2>&1 # For more information on cpan2rpm please visit: http://perl.arix.com/ # %define pkgname Lingua-EN-Squeeze %define filelist %{pkgname}-%{version}-filelist %define NVR %{pkgname}-%{version}-%{release} %define maketest 1 name: perl-Lingua-EN-Squeeze summary: Lingua-EN-Squeeze - Shorten text to minimum syllables by using hash table lookup and vowel deletion version: 2006.0704 release: 1 vendor: packager: Arix International license: Artistic group: Applications/CPAN url: http://www.cpan.org buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n) buildarch: noarch prefix: %(echo %{_prefix}) source: http://search.cpan.org//CPAN/authors/id/J/JA/JARIAALTO/Lingua-EN-Squeeze-2006.0704.tar.gz %description Squeeze english text to most compact format possible so that it is barely readable. Be sure to convert all text to lowercase before using the SqueezeText() for maximum compression, because optimizations have been designed mostly for uncapitalized letters. `Warning: Each line is processed multiple times, so prepare for slow conversion time' You can use this module e.g. to preprocess text before it is sent to electronic media that has some maximum text size limit. For example pagers have an arbitrary text size limit, typically around 200 characters, which you want to fill as much as possible. Alternatively you may have GSM cellular phone which is capable of receiving Short Messages (SMS), whose message size limit is 160 characters. For demonstration of this module's SqueezeText() function, this paragraph's conversion result is presented below. See yourself if it's readable (Yes, it takes some time to get used to). The compression ratio is typically 30-40% u _n use thi mod e.g. to prprce txt bfre i_s snt to elrnic mda has som max txt siz lim. f_xmple pag hv abitry txt siz lim, tpcly 200 chr, W/ u wnt to fll as mch as psbleAlternatvly u may hv GSM cllar P8 w_s cpble of rcivng Short msg (SMS), WS/ msg siz lim is 160 chr. 4 demonstrton of thi mods SquezText fnc , dsc txt of thi prgra has ben cnvd_ blow See uself if i_s redble (Yes, it tak som T to get usdto compr rat is tpcly 30-40 And if $SQZ_OPTIMIZE_LEVEL is set to non-zero u_nUseThiModE.g.ToPrprceTxtBfreI_sSntTo elrnicMdaHasSomMaxTxtSizLim.F_xmplePag hvAbitryTxtSizLim,Tpcly200Chr,W/UWnt toFllAsMchAsPsbleAlternatvlyUMayHvGSMCllarP8 w_sCpbleOfRcivngShortMsg(SMS),WS/MsgSiz limIs160Chr.4DemonstrtonOfThiModsSquezText fnc,DscTxtOfThiPrgraHasBenCnvd_Blow SeeUselfIfI_sRedble(Yes,ItTakSomTToGetUsdto comprRatIsTpcly30-40 The comparision of these two show Original text : 627 characters Level 0 : 433 characters reduction 31 % Level 1 : 345 characters reduction 45 % (+14% improvement) There are few grammar rules which are used to shorten some English tokens considerably: Word that has _ is usually a verb Word that has / is usually a substantive, noun, pronomine or other non-verb Read following substituting tokens in order to understand the basics of converted text. Hopefully, the text is not pure Geek code (tm) to you after some practice. In Geek code (Like G++L--J) you would need an external parser to understand it. Here some common sense and time is needed to adapt oneself to the compressed format. *For a complete up to date list, you would be better off peeking the source code* automatically => 'acly_' for => 4 for him => 4h for her => 4h for them => 4t for those => 4t can => _n does => _s it is => i_s that is => t_s which is => w_s that are => t_r which are => w_r less => -/ more => +/ most => ++ however => h/ver think => thk_ useful => usful you => u your => u/ you'd => u/d you'll => u/l they => t/ their => t/r will => /w would => /d with => w/ without => w/o which => W/ whose => WS/ Time is expressed with big letters time => T minute => MIN second => SEC hour => HH day => DD month => MM year => YY Other big letter acronyms, think 8 to represent the speaker and the microphone. phone => P8 # # This package was generated automatically with the cpan2rpm # utility. To get this software or for more information # please visit: http://perl.arix.com/ # %prep %setup -q -n %{pkgname}-%{version} chmod -R u+w %{_builddir}/%{pkgname}-%{version} %build grep -rsl '^#!.*perl' . | grep -v '.bak$' |xargs --no-run-if-empty \ %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' CFLAGS="$RPM_OPT_FLAGS" %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '` %{__make} %if %maketest %{__make} test %endif %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '` cmd=/usr/share/spec-helper/compress_files [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress [ -x $cmd ] && $cmd # SuSE Linux if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ] then %{__mkdir_p} %{buildroot}/var/adm/perl-modules %{__cat} `find %{buildroot} -name "perllocal.pod"` \ | %{__sed} -e s+%{buildroot}++g \ > %{buildroot}/var/adm/perl-modules/%{name} fi # remove special files find %{buildroot} -name "perllocal.pod" \ -o -name ".packlist" \ -o -name "*.bs" \ |xargs -i rm -f {} # no empty directories find %{buildroot}%{_prefix} \ -type d -depth \ -exec rmdir {} \; 2>/dev/null %{__perl} -MFile::Find -le ' find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}"); print "%doc INSTALL README"; for my $x (sort @dirs, @files) { push @ret, $x unless indirs($x); } print join "\n", sort @ret; sub wanted { return if /auto$/; local $_ = $File::Find::name; my $f = $_; s|^\Q%{buildroot}\E||; return unless length; return $files[@files] = $_ if -f $f; $d = $_; /\Q$d\E/ && return for reverse sort @INC; $d =~ /\Q$_\E/ && return for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|; $dirs[@dirs] = $_; } sub indirs { my $x = shift; $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs; } ' > %filelist [ -z %filelist ] && { echo "ERROR: empty %files listing" exit -1 } %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files -f %filelist %defattr(-,root,root) %changelog * Mon Oct 11 2010 rpm@janus.arix.com - Initial build.