Lingua::LangId::Utils - language guesser: generic utilities


NAME

Lingua::LangId::Utils - language guesser: generic utilities

(Back to Top)


SYNOPSIS

 ##========================================================================
 ## PRELIMINARIES
 
 use Lingua::LangId::Utils;
 
 ##========================================================================
 ## Functions: generic utilities
 
 ($outfh,\$str) = stringfh($mode);
 $min = min2($x,$y);
 $max = max2($x,$y);
 $coefs         = ylinfit($y,$x) ##-- scalar context;
 $coefs         = ylogfit($y,$x) ##-- scalar context;

(Back to Top)


DESCRIPTION

Globals & Constants

Variable: %EXPORT_TAGS

Following tags are exportabe:

 fit=>[qw(ylinfit ylogfit)],
 norm=>[qw(_gausscdf _gausswidth)],
 cmp=>[qw(min2 max2)],
 io=>[qw(stringfh)],
 all=>$ALL_OF_THE_ABOVE
Variable: @EXPORT_OK

All functions exportable under any tag are exportable.

Variable: @EXPORT

Everything is exported by default.

Functions: generic utilities

stringfh
 ($outfh,\$str) = stringfh($mode);
 ($outfh,\$str) = stringfh($mode,\$str)

Returns new filehandle for I/O from/to \$str, which defaults to a new string. $mode defaults to '+<' (read/write).

min2
 $min = min2($x,$y);

Binary minimum operator for numeric scalars.

max2
 $max = max2($x,$y);

Binary maximum operator for numeric scalars.

ylinfit
 $coefs         = ylinfit($y,$x) ##-- scalar context;
 ($yfit,$coefs) = ylinfit($y,$x) ##-- array context

Linear fits $y to $x using PDL::Fit::linfit::linfit1d().

$coeffs are [$a,$b] such that:

 all($yfit == $a*$x + $b)
ylogfit
 $coefs         = ylogfit($y,$x) ##-- scalar context;
 ($yfit,$coefs) = ylogfit($y,$x) ##-- array context

Linear fits log($y) to log($x) using ylinfit().

$coeffs are [$a,$b] such that:

 all($yfit == $b*($x**$a))
_gausscdf
 $pvals = gausscdf($xvals, $mu,$sigma);

Returns p-values (pdl) corrsponding to $xvals for normal distribution with parameters ($mu,$sigma).

_gausswidth
 $width = gausswidth($confidence, $mu,$sigma);                  ##-- scalar context
 ($mu-$width,$mu+$width) = gausswidth($confidence, $mu,$sigma); ##-- array context

In scalar context, returns width around mean corresponding to confidence level $confidence In array context, returns interval around mean for level $confidence.

(Back to Top)


SEE ALSO

Lingua::LangId(3pm)

(Back to Top)


AUTHOR

Bryan Jurish <jurish@uni-potsdam.de>

(Back to Top)


COPYRIGHT AND LICENSE

Copyright (C) 2009 by Bryan Jurish

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

(Back to Top)

 Lingua::LangId::Utils - language guesser: generic utilities