text
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 3003
GD::Text 0.86
GD::Text is a Perl module with text utilities for use with GD. more>>
GD::Text is a Perl module with text utilities for use with GD.
SYNOPSIS
use GD;
use GD::Text;
my $gd_text = GD::Text->new() or die GD::Text::error();
$gd_text->set_font(funny.ttf, 12) or die $gd_text->error;
$gd_text->set_font(gdTinyFont);
$gd_text->set_font(GD::Font::Tiny);
...
$gd_text->set_text($string);
my ($w, $h) = $gd_text->get(width, height);
if ($gd_text->is_ttf)
{
...
}
Or alternatively
my $gd_text = GD::Text->new(
text => Some text,
font => funny.ttf,
ptsize => 14,
);
This module provides a font-independent way of dealing with text in GD, for use with the GD::Text::* modules and GD::Graph.
<<lessSYNOPSIS
use GD;
use GD::Text;
my $gd_text = GD::Text->new() or die GD::Text::error();
$gd_text->set_font(funny.ttf, 12) or die $gd_text->error;
$gd_text->set_font(gdTinyFont);
$gd_text->set_font(GD::Font::Tiny);
...
$gd_text->set_text($string);
my ($w, $h) = $gd_text->get(width, height);
if ($gd_text->is_ttf)
{
...
}
Or alternatively
my $gd_text = GD::Text->new(
text => Some text,
font => funny.ttf,
ptsize => 14,
);
This module provides a font-independent way of dealing with text in GD, for use with the GD::Text::* modules and GD::Graph.
Download (0.063MB)
Added: 2006-10-02 License: Perl Artistic License Price:
648 downloads
Text::EP3 1.10
EP3 Perl module is the Extensible Perl PreProcessor. more>>
EP3 Perl module is the Extensible Perl PreProcessor.
SYNOPSIS
# Use options and files from command-line
use Text::EP3;
[use Text::EP3::{Extension}] # Language Specific Modules
# create the PreProcessor object
my $preprocessor = new Text::EP3 file;
# do the preprocessing, using command-line options from @ARGV
$preprocessor->ep3_execute;
# Set options and files from the Perl script
use Text::EP3;
[use Text::EP3::{Extension}] # Language Specific Modules
# create the PreProcessor object
my $preprocessor = new Text::EP3 file;
# configure the PreProcessor object (optional)
$preprocessor->ep3_output_file([$filename]);
$preprocessor->ep3_modules([@modules]);
$preprocessor->ep3_includes([@include_directories]);
$preprocessor->ep3_reset;
$preprocessor->ep3_start_comment([$string]);
$preprocessor->ep3_end_comment([$string]);
$preprocessor->ep3_line_comment([$string]);
$preprocessor->ep3_delimiter([$string]);
$preprocessor->ep3_gen_depend_list([$value]);
$preprocessor->ep3_keep_comments([$value]);
$preprocessor->ep3_protect_comments([$value]);
$preprocessor->ep3_defines($string1=$string2);
# do the preprocessing
$preprocessor->ep3_process([$filename, [$condition]]);
EP3 is a Perl5 program that preprocesses STDIN or some set of input files and produces an output file. EP3 only works on input files and produces output files. It seems to me that if you want to preprocess arrays or somesuch, you should be using perl. EP3 was first developed to provide a flexible preprocessor for the Verilog hardware description language.
Verilog presents some problems that were not easily solved by using cpp or m4. I wanted to be able to use a normal preprocessor, but extend its functionality. So I wrote EP3 - the Extensible Perl PreProcessor. The main difference between EP3 and other preprocessors is its built-in extensibility. Every directive in EP3 is really a method defined in EP3, one of its submodules, or embedded in the file that is being processed. By linking the directive name to the associated methods, other methods could be added, thus extending the preprocessor.
<<lessSYNOPSIS
# Use options and files from command-line
use Text::EP3;
[use Text::EP3::{Extension}] # Language Specific Modules
# create the PreProcessor object
my $preprocessor = new Text::EP3 file;
# do the preprocessing, using command-line options from @ARGV
$preprocessor->ep3_execute;
# Set options and files from the Perl script
use Text::EP3;
[use Text::EP3::{Extension}] # Language Specific Modules
# create the PreProcessor object
my $preprocessor = new Text::EP3 file;
# configure the PreProcessor object (optional)
$preprocessor->ep3_output_file([$filename]);
$preprocessor->ep3_modules([@modules]);
$preprocessor->ep3_includes([@include_directories]);
$preprocessor->ep3_reset;
$preprocessor->ep3_start_comment([$string]);
$preprocessor->ep3_end_comment([$string]);
$preprocessor->ep3_line_comment([$string]);
$preprocessor->ep3_delimiter([$string]);
$preprocessor->ep3_gen_depend_list([$value]);
$preprocessor->ep3_keep_comments([$value]);
$preprocessor->ep3_protect_comments([$value]);
$preprocessor->ep3_defines($string1=$string2);
# do the preprocessing
$preprocessor->ep3_process([$filename, [$condition]]);
EP3 is a Perl5 program that preprocesses STDIN or some set of input files and produces an output file. EP3 only works on input files and produces output files. It seems to me that if you want to preprocess arrays or somesuch, you should be using perl. EP3 was first developed to provide a flexible preprocessor for the Verilog hardware description language.
Verilog presents some problems that were not easily solved by using cpp or m4. I wanted to be able to use a normal preprocessor, but extend its functionality. So I wrote EP3 - the Extensible Perl PreProcessor. The main difference between EP3 and other preprocessors is its built-in extensibility. Every directive in EP3 is really a method defined in EP3, one of its submodules, or embedded in the file that is being processed. By linking the directive name to the associated methods, other methods could be added, thus extending the preprocessor.
Download (0.020MB)
Added: 2007-05-31 License: Perl Artistic License Price:
876 downloads
Text::CPP 0.12
Text::CPP is a full C Preprocessor in XS. more>>
Text::CPP is a full C Preprocessor in XS.
SYNOPSIS
use Text::CPP;
my $reader = new Text::CPP(
Language => CLK_GNUC99,
Options => {
...
},
Builtins => {
foo => this,
bar => that,
},
);
$reader->read("file.c");
while (my $token = $reader->token) {
print "Token: $tokenn";
}
$reader->data->{MyKey} = $MyData;
A fast C preprocessor in XS. This does not require an external C preprocessor, and will not fork() or exec() any external process.
USAGE
The following methods have been implemented, allowing the use of this module as a pure C preprocessor, or as a lexer for a C, C++ or Assembler-like language.
new Text::CPP(...)
Takes a hash or hashref with the following possible keys:
Language
Defines the source language to preprocess and/or tokenise. It may be any of:
CLK_GNUC89 - GNU C89
CLK_GNUC99 - GNU C99
CLK_STDC89 - Standard C89
CLK_STDC94 - Standard C94
CLK_STDC99 - Standard C99
CLK_GNUCXX - GNU C++
CLK_CXX98 - Standard C++ 98
CLK_ASM - Assembler
Options
A hashref of options for the preprocessor. Valid entries are given with alternative forms (from GNU cpp) in brackets.
Define (-D): array of strings or hash
Strings should be of the form NAME=VALUE.
Undef (-U): array of strings
DiscardComments (-C): boolean
DiscardCommentsInMacroExp (-CC): boolean
PrintIncludeNames (-H): boolean
NoLineCommands (-P): boolean
WarnComments (-Wcomment -Wcomments): boolean
WarnDeprecated (-Wdeprecated): boolean
WarningsAreErrors (-Werror): boolean
WarnImport (-Wimport): boolean
WarnMultichar (-Wmultichar): boolean
WarnSystemHeaders (-Wsystem-headers): boolean
Ignore errors in system header files.
WarnTraditional (-Wtraditional): boolean
WarnTrigraphs (-Wtrigraphs): boolean
WarnUnusedMacros (-Wunused-macros): boolean
Pedantic (-pedantic): boolean
PedanticErrors (-pedantic-errors): boolean
Implies, and overrides, Pedantic.
Remap (-remap): boolean
Deal with some brokennesses of MSDOS. Untested.
Trigraphs (-trigraphs): boolean
Traditional (-traditional): boolean
NoWarnings (-w): boolean
IncludePrefix (-iprefix): string
SystemRoot (-isysroot): string
Include (-include): array of strings
Include the specified files before reading the main file to be processed.
IncludeMacros (-imacros): array of strings
Include the specified files before reading the main file to be processed. Output from preprocessing these files is discarded. Files specified by IncludeMacros are processed before files specified by Include.
IncludePath (-I): array of strings
This include path is searched first.
SystemIncludePath (-isystem): array of strings
Specify the standard system include path, searched second.
AfterIncludePath (-idirafter): array of strings
This include path is searched after the system include path.
Builtins
A hashref of predefined macros. The values must be strings or integers. Macros in this hash will be defined before preprocessing starts. These correspond to true "builtin" macros. You should probably prefer to use the Define option.
$text = $reader->token
($text, $type, $flags) = $reader->token
Return the next available preprocessed token. Some tokens are not stringifiable. These include tokens of type CPP_MACRO_ARG, CPP_PADDING and CPP_EOF. Text::CPP returns a dummy string in the text field for these tokens. Tokens of type CPP_EOF should never actually be returned.
@tokens = $reader->tokens
Preprocess and return a list of tokens. This is approximately equivalent to:
push(@tokens, $_) while ($_ = $reader->token);
$reader->type($type)
Return a human readable name for a token type, as returned by $reader->token.
$reader->data
Returns a hashref in which user data may be stored by subclasses. This hashref is created with a new Text::CPP object, and is ignored for all functional purposes. The user may do with it as he wishes.
$reader->errors
In scalar context, returns the fatal error count. In list context, returns a list of warnings and errors encountered by the preprocessor. Thus scalar(@errors) >= $errors, since @errors will also contain the warnings.
<<lessSYNOPSIS
use Text::CPP;
my $reader = new Text::CPP(
Language => CLK_GNUC99,
Options => {
...
},
Builtins => {
foo => this,
bar => that,
},
);
$reader->read("file.c");
while (my $token = $reader->token) {
print "Token: $tokenn";
}
$reader->data->{MyKey} = $MyData;
A fast C preprocessor in XS. This does not require an external C preprocessor, and will not fork() or exec() any external process.
USAGE
The following methods have been implemented, allowing the use of this module as a pure C preprocessor, or as a lexer for a C, C++ or Assembler-like language.
new Text::CPP(...)
Takes a hash or hashref with the following possible keys:
Language
Defines the source language to preprocess and/or tokenise. It may be any of:
CLK_GNUC89 - GNU C89
CLK_GNUC99 - GNU C99
CLK_STDC89 - Standard C89
CLK_STDC94 - Standard C94
CLK_STDC99 - Standard C99
CLK_GNUCXX - GNU C++
CLK_CXX98 - Standard C++ 98
CLK_ASM - Assembler
Options
A hashref of options for the preprocessor. Valid entries are given with alternative forms (from GNU cpp) in brackets.
Define (-D): array of strings or hash
Strings should be of the form NAME=VALUE.
Undef (-U): array of strings
DiscardComments (-C): boolean
DiscardCommentsInMacroExp (-CC): boolean
PrintIncludeNames (-H): boolean
NoLineCommands (-P): boolean
WarnComments (-Wcomment -Wcomments): boolean
WarnDeprecated (-Wdeprecated): boolean
WarningsAreErrors (-Werror): boolean
WarnImport (-Wimport): boolean
WarnMultichar (-Wmultichar): boolean
WarnSystemHeaders (-Wsystem-headers): boolean
Ignore errors in system header files.
WarnTraditional (-Wtraditional): boolean
WarnTrigraphs (-Wtrigraphs): boolean
WarnUnusedMacros (-Wunused-macros): boolean
Pedantic (-pedantic): boolean
PedanticErrors (-pedantic-errors): boolean
Implies, and overrides, Pedantic.
Remap (-remap): boolean
Deal with some brokennesses of MSDOS. Untested.
Trigraphs (-trigraphs): boolean
Traditional (-traditional): boolean
NoWarnings (-w): boolean
IncludePrefix (-iprefix): string
SystemRoot (-isysroot): string
Include (-include): array of strings
Include the specified files before reading the main file to be processed.
IncludeMacros (-imacros): array of strings
Include the specified files before reading the main file to be processed. Output from preprocessing these files is discarded. Files specified by IncludeMacros are processed before files specified by Include.
IncludePath (-I): array of strings
This include path is searched first.
SystemIncludePath (-isystem): array of strings
Specify the standard system include path, searched second.
AfterIncludePath (-idirafter): array of strings
This include path is searched after the system include path.
Builtins
A hashref of predefined macros. The values must be strings or integers. Macros in this hash will be defined before preprocessing starts. These correspond to true "builtin" macros. You should probably prefer to use the Define option.
$text = $reader->token
($text, $type, $flags) = $reader->token
Return the next available preprocessed token. Some tokens are not stringifiable. These include tokens of type CPP_MACRO_ARG, CPP_PADDING and CPP_EOF. Text::CPP returns a dummy string in the text field for these tokens. Tokens of type CPP_EOF should never actually be returned.
@tokens = $reader->tokens
Preprocess and return a list of tokens. This is approximately equivalent to:
push(@tokens, $_) while ($_ = $reader->token);
$reader->type($type)
Return a human readable name for a token type, as returned by $reader->token.
$reader->data
Returns a hashref in which user data may be stored by subclasses. This hashref is created with a new Text::CPP object, and is ignored for all functional purposes. The user may do with it as he wishes.
$reader->errors
In scalar context, returns the fatal error count. In list context, returns a list of warnings and errors encountered by the preprocessor. Thus scalar(@errors) >= $errors, since @errors will also contain the warnings.
Download (0.17MB)
Added: 2007-05-29 License: Perl Artistic License Price:
878 downloads
Text::Yats 0.03
Text::Yats is Yet Another Template System. more>>
Text::Yats is Yet Another Template System.
SYNOPSIS
use Text::Yats;
my $template = < < ENDHTML;
< html >
< head >
< title >$title - $version< /title >
< /head >
< body >
< form >
< select name="names" >< !--{1}-- >
< option $selected >$list< /option >
< !--{2}-- >< /select >
< /form >
< /body >
< /html >
ENDHTML
my $result = "";
my $tpl = Text::Yats- >new(
level = > 1,
text = > $template);
$result .= $tpl- >section- >[0]- >replace(
title = > "Yats",
version = > "Development", );
$result .= $tpl- >section- >[1]- >replace(
list = > [hdias,anita,cubitos],
selected = > { value = > "selected",
array = > "list",
match = > "anita", } );
$result .= $tpl- >section- >[2]- >text;
print $result;
<<lessSYNOPSIS
use Text::Yats;
my $template = < < ENDHTML;
< html >
< head >
< title >$title - $version< /title >
< /head >
< body >
< form >
< select name="names" >< !--{1}-- >
< option $selected >$list< /option >
< !--{2}-- >< /select >
< /form >
< /body >
< /html >
ENDHTML
my $result = "";
my $tpl = Text::Yats- >new(
level = > 1,
text = > $template);
$result .= $tpl- >section- >[0]- >replace(
title = > "Yats",
version = > "Development", );
$result .= $tpl- >section- >[1]- >replace(
list = > [hdias,anita,cubitos],
selected = > { value = > "selected",
array = > "list",
match = > "anita", } );
$result .= $tpl- >section- >[2]- >text;
print $result;
Download (0.005MB)
Added: 2007-08-10 License: Perl Artistic License Price:
805 downloads
Text::Quote 0.3
Text::Quote contains quotes strings as required for perl to eval them back correctly. more>>
Text::Quote contains quotes strings as required for perl to eval them back correctly.
SYNOPSIS
use Text::Quote;
my @quotes=map{$quoter->quote($_,indent=>6,col_width=>60)}(
"The time has come"
the walrus said,
"to speak of many things..."
," 123456abtn13fr16172021222324252627303132e34353637",
("6abtn13fr32e34" x 5),2/3,10,00);
for my $i (1..@quotes) {
print "$var$i=".$quotes[$i-1].";n";
}
Would produce:
$var1=qq"The time has come"ntthetwalrus said,nt"to speak of man.
qqy things...";
$var2=" 123456abtn13fr16172021222324252627".
"303132e34353637";
$var3=("6abtn13fr32e34" x 5);
$var4=0.666666666666667;
$var5=10;
$var6=00;
<<lessSYNOPSIS
use Text::Quote;
my @quotes=map{$quoter->quote($_,indent=>6,col_width=>60)}(
"The time has come"
the walrus said,
"to speak of many things..."
," 123456abtn13fr16172021222324252627303132e34353637",
("6abtn13fr32e34" x 5),2/3,10,00);
for my $i (1..@quotes) {
print "$var$i=".$quotes[$i-1].";n";
}
Would produce:
$var1=qq"The time has come"ntthetwalrus said,nt"to speak of man.
qqy things...";
$var2=" 123456abtn13fr16172021222324252627".
"303132e34353637";
$var3=("6abtn13fr32e34" x 5);
$var4=0.666666666666667;
$var5=10;
$var6=00;
Download (0.012MB)
Added: 2007-08-06 License: Perl Artistic License Price:
810 downloads
Text::Diff 0.35
Text::Diff can perform diffs on files and record sets. more>>
Text::Diff can perform diffs on files and record sets.
SYNOPSIS
use Text::Diff;
## Mix and match filenames, strings, file handles, producer subs,
## or arrays of records; returns diff in a string.
## WARNING: can return B diffs for large files.
my $diff = diff "file1.txt", "file2.txt", { STYLE => "Context" };
my $diff = diff $string1, $string2, %options;
my $diff = diff *FH1, *FH2;
my $diff = diff &reader1, &reader2;
my $diff = diff @records1, @records2;
## May also mix input types:
my $diff = diff @records1, "file_B.txt";
diff() provides a basic set of services akin to the GNU diff utility. It is not anywhere near as feature complete as GNU diff, but it is better integrated with Perl and available on all platforms. It is often faster than shelling out to a systems diff executable for small files, and generally slower on larger files.
Relies on Algorithm::Diff for, well, the algorithm. This may not produce the same exact diff as a systems local diff executable, but it will be a valid diff and comprehensible by patch. We havent seen any differences between Algorithm::Diffs logic and GNU diffs, but we have not examined them to make sure they are indeed identical.
Note: If you dont want to import the diff function, do one of the following:
use Text::Diff ();
require Text::Diff;
Thats a pretty rare occurence, so diff() is exported by default.
<<lessSYNOPSIS
use Text::Diff;
## Mix and match filenames, strings, file handles, producer subs,
## or arrays of records; returns diff in a string.
## WARNING: can return B diffs for large files.
my $diff = diff "file1.txt", "file2.txt", { STYLE => "Context" };
my $diff = diff $string1, $string2, %options;
my $diff = diff *FH1, *FH2;
my $diff = diff &reader1, &reader2;
my $diff = diff @records1, @records2;
## May also mix input types:
my $diff = diff @records1, "file_B.txt";
diff() provides a basic set of services akin to the GNU diff utility. It is not anywhere near as feature complete as GNU diff, but it is better integrated with Perl and available on all platforms. It is often faster than shelling out to a systems diff executable for small files, and generally slower on larger files.
Relies on Algorithm::Diff for, well, the algorithm. This may not produce the same exact diff as a systems local diff executable, but it will be a valid diff and comprehensible by patch. We havent seen any differences between Algorithm::Diffs logic and GNU diffs, but we have not examined them to make sure they are indeed identical.
Note: If you dont want to import the diff function, do one of the following:
use Text::Diff ();
require Text::Diff;
Thats a pretty rare occurence, so diff() is exported by default.
Download (0.015MB)
Added: 2007-08-09 License: Perl Artistic License Price:
493 downloads
Download (0.032MB)
Added: 2007-06-14 License: Perl Artistic License Price:
862 downloads
Text::Graph 0.23
Text::Graph is a Perl extension for generating text-based graphs. more>>
Text::Graph is a Perl extension for generating text-based graphs.
SYNOPSIS
use Text::Graph;
blah blah blah
Some data is easier to analyze graphically than in its raw form. In many cases, however, a full-blown multicolor graphic representation is overkill. In these cases, a simple graph can provide an appropriate graphical representation.
The Text::Graph module provides a simple text-based graph of a dataset. Although this approach is not appropriate for all data analysis, it can be useful in some cases.
<<lessSYNOPSIS
use Text::Graph;
blah blah blah
Some data is easier to analyze graphically than in its raw form. In many cases, however, a full-blown multicolor graphic representation is overkill. In these cases, a simple graph can provide an appropriate graphical representation.
The Text::Graph module provides a simple text-based graph of a dataset. Although this approach is not appropriate for all data analysis, it can be useful in some cases.
Download (0.009MB)
Added: 2006-08-28 License: Perl Artistic License Price:
1153 downloads
Text::Ngrams 1.9
Text::Ngrams is a flexible Ngram analysis (for characters, words, and more). more>>
Text::Ngrams is a flexible Ngram analysis (for characters, words, and more).
SYNOPSIS
For default character n-gram analysis of string:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->process_text(abcdefg1235678hijklmnop);
print $ng3->to_string;
my @ngramsarray = $ng3->get_ngrams;
One can also feed tokens manually:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->feed_tokens(a);
$ng3->feed_tokens(b);
$ng3->feed_tokens(c);
$ng3->feed_tokens(d);
$ng3->feed_tokens(e);
$ng3->feed_tokens(f);
$ng3->feed_tokens(g);
$ng3->feed_tokens(h);
We can choose n-grams of various sizes, e.g.:
my $ng = Text::Ngrams->new( windowsize => 6 );
or different types of n-grams, e.g.:
my $ng = Text::Ngrams->new( type => byte );
my $ng = Text::Ngrams->new( type => word );
my $ng = Text::Ngrams->new( type => utf8 );
To process a list of files:
$ng->process_files(somefile.txt, otherfile.txt);
This module implement text n-gram analysis, supporting several types of analysis, including character and word n-grams.
The module Text::Ngrams is very flexible. For example, it allows a user to manually feed a sequence of any tokens. It handles several types of tokens (character, word), and also allows a lot of flexibility in automatic recognition and feed of tokens and the way they are combined in an n-gram. It counts all n-gram frequencies up to the maximal specified length. The output format is meant to be pretty much human-readable, while also loadable by the module.
The module can be used from the command line through the script ngrams.pl provided with the package.
Version restrictions:
- If a user customizes a type, it is possible that a resulting n-gram will be ambiguous. In this way, to different n-grams may be counted as one. With predefined types of n-grams, this should not happen. For example, if a user chooses that a token can contain a space, and uses space as an n-gram separator, then a trigram like this "x x x x" is ambiguous.
- Method process_file does not handle multi-line tokens by default. This can be fixed, but it does not seem to be worth the code complication. There are various ways around this if one really needs such tokens: One way is to preprocess them. Another way is to read as much text as necessary at a time then to use process_text, which does handle multi-line tokens.
<<lessSYNOPSIS
For default character n-gram analysis of string:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->process_text(abcdefg1235678hijklmnop);
print $ng3->to_string;
my @ngramsarray = $ng3->get_ngrams;
One can also feed tokens manually:
use Text::Ngrams;
my $ng3 = Text::Ngrams->new;
$ng3->feed_tokens(a);
$ng3->feed_tokens(b);
$ng3->feed_tokens(c);
$ng3->feed_tokens(d);
$ng3->feed_tokens(e);
$ng3->feed_tokens(f);
$ng3->feed_tokens(g);
$ng3->feed_tokens(h);
We can choose n-grams of various sizes, e.g.:
my $ng = Text::Ngrams->new( windowsize => 6 );
or different types of n-grams, e.g.:
my $ng = Text::Ngrams->new( type => byte );
my $ng = Text::Ngrams->new( type => word );
my $ng = Text::Ngrams->new( type => utf8 );
To process a list of files:
$ng->process_files(somefile.txt, otherfile.txt);
This module implement text n-gram analysis, supporting several types of analysis, including character and word n-grams.
The module Text::Ngrams is very flexible. For example, it allows a user to manually feed a sequence of any tokens. It handles several types of tokens (character, word), and also allows a lot of flexibility in automatic recognition and feed of tokens and the way they are combined in an n-gram. It counts all n-gram frequencies up to the maximal specified length. The output format is meant to be pretty much human-readable, while also loadable by the module.
The module can be used from the command line through the script ngrams.pl provided with the package.
Version restrictions:
- If a user customizes a type, it is possible that a resulting n-gram will be ambiguous. In this way, to different n-grams may be counted as one. With predefined types of n-grams, this should not happen. For example, if a user chooses that a token can contain a space, and uses space as an n-gram separator, then a trigram like this "x x x x" is ambiguous.
- Method process_file does not handle multi-line tokens by default. This can be fixed, but it does not seem to be worth the code complication. There are various ways around this if one really needs such tokens: One way is to preprocess them. Another way is to read as much text as necessary at a time then to use process_text, which does handle multi-line tokens.
Download (0.036MB)
Added: 2007-08-22 License: Perl Artistic License Price:
802 downloads
Text::Scrub 0.08
Text::Scrub is a Perl module used to wild card out text used for comparison. more>>
Text::Scrub is a Perl module used to wild card out text used for comparison.
SYNOPSIS
#########
# Subroutine Interface
#
use Text::Scrub qw(scrub_date scrub_date_ticket scrub_date_version scrub_file_line
scrub_probe scrub_test_file);
$scrubbed_text = scrub_architect($script_text)
$scrubbed_text = scrub_file_line($script_text)
$scrubbed_text = scrub_date($script_text)
$scrubbed_text = scrub_date_ticket($script_text)
$scrubbed_text = scrub_date_version($script_text)
$scrubbed_text = scrub_probe($script_text)
$scrubbed_text = scrub_test_file($script_text)
#########
# Class Interface
#
use Text::Scrub
$scrubbed_text = Text::Scrub->scrub_architect($script_text)
$scrubbed_text = Text::Scrub->scrub_file_line($script_text)
$scrubbed_text = Text::Scrub->scrub_date($script_text)
$scrubbed_text = Text::Scrub->scrub_date_ticket($script_text)
$scrubbed_text = Text::Scrub->scrub_date_version($script_text)
$scrubbed_text = Text::Scrub->scrub_probe($script_text)
$scrubbed_text = Text::Scrub->scrub_test_file($script_text)
The methods in the Test::STD:Scrub package are designed to support the Test::STDmaker and the ExtUtils::SVDmaker package. This is the focus and no other focus. Since Test::STD::Scrub is a separate package, the methods may be used elsewhere. They are used to wild card out parts of two documents before they are compared by making these snippets the same. In all likehood, any revisions will maintain backwards compatibility with previous revisions. However, support and the performance of the Test::STDmaker and ExtUtils::SVDmaker packages has priority over backwards compatibility.
<<lessSYNOPSIS
#########
# Subroutine Interface
#
use Text::Scrub qw(scrub_date scrub_date_ticket scrub_date_version scrub_file_line
scrub_probe scrub_test_file);
$scrubbed_text = scrub_architect($script_text)
$scrubbed_text = scrub_file_line($script_text)
$scrubbed_text = scrub_date($script_text)
$scrubbed_text = scrub_date_ticket($script_text)
$scrubbed_text = scrub_date_version($script_text)
$scrubbed_text = scrub_probe($script_text)
$scrubbed_text = scrub_test_file($script_text)
#########
# Class Interface
#
use Text::Scrub
$scrubbed_text = Text::Scrub->scrub_architect($script_text)
$scrubbed_text = Text::Scrub->scrub_file_line($script_text)
$scrubbed_text = Text::Scrub->scrub_date($script_text)
$scrubbed_text = Text::Scrub->scrub_date_ticket($script_text)
$scrubbed_text = Text::Scrub->scrub_date_version($script_text)
$scrubbed_text = Text::Scrub->scrub_probe($script_text)
$scrubbed_text = Text::Scrub->scrub_test_file($script_text)
The methods in the Test::STD:Scrub package are designed to support the Test::STDmaker and the ExtUtils::SVDmaker package. This is the focus and no other focus. Since Test::STD::Scrub is a separate package, the methods may be used elsewhere. They are used to wild card out parts of two documents before they are compared by making these snippets the same. In all likehood, any revisions will maintain backwards compatibility with previous revisions. However, support and the performance of the Test::STDmaker and ExtUtils::SVDmaker packages has priority over backwards compatibility.
Download (0.062MB)
Added: 2007-02-15 License: Perl Artistic License Price:
982 downloads
Text::Indent 0.1
Text::Indent is a simple indentation of text shared among modules. more>>
Text::Indent is a simple indentation of text shared among modules.
SYNOPSIS
In your main program:
use Text::Indent;
my $indent = Text::Indent->new;
$indent->spaces(2);
In a module to produce indented output:
use Text::Indent;
my $indent = Text::Indent->instance;
$indent->increase;
print $indent->indent("this will be indented two spaces");
$indent->increase(2);
print $indent->indent("this will be indented six spaces");
$indent->decrease(3);
Text::Indent is designed for use in programs which need to produce output with multiple levels of indent when the source of the output comes from different modules that know nothing about each other.
For example take module A, whose output includes the indented output of module B. Module B can also produce output directly, so it falls to module B to know whether it should indent its output or not depending on its calling context.
Text::Indent allows programs and modules to cooperate to choose an appropriate indent level that is shared within the program context. In the above example, module A would increase the indent level prior to calling the output routines of module B. Module B would simply use the Text::Indent instance confident that if it were being called directly no indent would be applied but if module A was calling it then its output would be indented one level.
<<lessSYNOPSIS
In your main program:
use Text::Indent;
my $indent = Text::Indent->new;
$indent->spaces(2);
In a module to produce indented output:
use Text::Indent;
my $indent = Text::Indent->instance;
$indent->increase;
print $indent->indent("this will be indented two spaces");
$indent->increase(2);
print $indent->indent("this will be indented six spaces");
$indent->decrease(3);
Text::Indent is designed for use in programs which need to produce output with multiple levels of indent when the source of the output comes from different modules that know nothing about each other.
For example take module A, whose output includes the indented output of module B. Module B can also produce output directly, so it falls to module B to know whether it should indent its output or not depending on its calling context.
Text::Indent allows programs and modules to cooperate to choose an appropriate indent level that is shared within the program context. In the above example, module A would increase the indent level prior to calling the output routines of module B. Module B would simply use the Text::Indent instance confident that if it were being called directly no indent would be applied but if module A was calling it then its output would be indented one level.
Download (0.005MB)
Added: 2007-08-08 License: Perl Artistic License Price:
807 downloads
Text::JavE 0.0.2
Text::JavE is a Perl module to view and manipulate ascii art and manipulation files created in JavE. more>>
Text::JavE is a Perl module to view and manipulate ascii art and manipulation files created in JavE.
JavE (http://www.jave.de/) is an excellent Ascii art editor and animator written in Java. Unfortunately it doesnt yet have a scripting interface. This module aims to make the work of processing its standard files (.jmov) easy within Perl.
SYNOPSIS
use Text::JavE;
my $j = new Text::JavE;
while (my $file=shift @ARGV) {
$j->open_jmov($file);
for (@{$j->{frames}}) {
system "cls"; # on Win32. Try system "clear" on Unix.
$_->display;
my $time = $_->{msec};
select (undef, undef, undef, $time/1000);
}
}
new()
Constructor. Returns a Text::JavE object which can play or otherwise manipulate jmov files.
decode($text)
Internal method to decode a jmov line containing a compressed ascii frame. There are 2 submethods decode_a and decode_b implementing the various encoding algorithms JavE currently uses.
display()
Shows the current frame.
open_clipart($file)
Opens a clipart file in JavEs .jcf format. (As far as I know this isnt officially documented, but a number of sample files are distributed with JavE).
open_jmov($file)
Opens a file in jmov format. This format is described in detail at http://www.jave.de/player/jmov_specification.html
A sample Chickenman animation is included in the distribution as t.jmov. More can be found at http://osfameron.perlmonk.org/chickenman/ Other jmov files can be found at http://www.jave.de
<<lessJavE (http://www.jave.de/) is an excellent Ascii art editor and animator written in Java. Unfortunately it doesnt yet have a scripting interface. This module aims to make the work of processing its standard files (.jmov) easy within Perl.
SYNOPSIS
use Text::JavE;
my $j = new Text::JavE;
while (my $file=shift @ARGV) {
$j->open_jmov($file);
for (@{$j->{frames}}) {
system "cls"; # on Win32. Try system "clear" on Unix.
$_->display;
my $time = $_->{msec};
select (undef, undef, undef, $time/1000);
}
}
new()
Constructor. Returns a Text::JavE object which can play or otherwise manipulate jmov files.
decode($text)
Internal method to decode a jmov line containing a compressed ascii frame. There are 2 submethods decode_a and decode_b implementing the various encoding algorithms JavE currently uses.
display()
Shows the current frame.
open_clipart($file)
Opens a clipart file in JavEs .jcf format. (As far as I know this isnt officially documented, but a number of sample files are distributed with JavE).
open_jmov($file)
Opens a file in jmov format. This format is described in detail at http://www.jave.de/player/jmov_specification.html
A sample Chickenman animation is included in the distribution as t.jmov. More can be found at http://osfameron.perlmonk.org/chickenman/ Other jmov files can be found at http://www.jave.de
Download (0.008MB)
Added: 2007-01-05 License: Perl Artistic License Price:
1022 downloads
Text::Macro 0.07
Text::Macro Perl module is a template facility whos focus is on generating code such as c, java or sql. more>>
Text::Macro Perl module is a template facility whos focus is on generating code such as c, java or sql. While generating perl code is also possible, there is a potential conflict between the control-symbol and the perl comment symbol.
Perl is excelent at manipulating text, and it begs the question why one would need such a tool.
The answer is that good code design should be such that applications should not have to be modified so as to make configuration changes. Thus external configuration files/data is used. However, if these files are read in as perl-code, then simple errors could crash the whole application (or provide subtle security risks). Further, it is often desired to invert the control flow and text-data (namely, make the embedded strings primary, and control-flow secondary). This is the ASP model, and for 90% HTML, 10% code, this works great.
This module supports many control facilities which directly translate into perl-control facilities (e.g. inverting the ASP-style code back into perl-style behind the scenes). The inversion process is cached in a simple user object.
The module was initially inspired by Text::FastTemplate by Robert Lehr, whos module didnt completely fullfill my needs.
Main features:
- fast, simple, robust
- code-generating-centric feature-set
- substitutions stand-out from template
- macro-code embedded in text
- OOP
- external and internal includes (for clearifying complex control-flow)
- scoped variable-substitutions
- line-based processing (like cpp)
- usable error messages
<<lessPerl is excelent at manipulating text, and it begs the question why one would need such a tool.
The answer is that good code design should be such that applications should not have to be modified so as to make configuration changes. Thus external configuration files/data is used. However, if these files are read in as perl-code, then simple errors could crash the whole application (or provide subtle security risks). Further, it is often desired to invert the control flow and text-data (namely, make the embedded strings primary, and control-flow secondary). This is the ASP model, and for 90% HTML, 10% code, this works great.
This module supports many control facilities which directly translate into perl-control facilities (e.g. inverting the ASP-style code back into perl-style behind the scenes). The inversion process is cached in a simple user object.
The module was initially inspired by Text::FastTemplate by Robert Lehr, whos module didnt completely fullfill my needs.
Main features:
- fast, simple, robust
- code-generating-centric feature-set
- substitutions stand-out from template
- macro-code embedded in text
- OOP
- external and internal includes (for clearifying complex control-flow)
- scoped variable-substitutions
- line-based processing (like cpp)
- usable error messages
Download (0.012MB)
Added: 2007-05-31 License: Perl Artistic License Price:
877 downloads
Text::Roman 3.01
Text::Roman is a Perl module that converts roman algarism in integer numbers and the contrary, recognize algarisms. more>>
Text::Roman is a Perl module that converts roman algarism in integer numbers and the contrary, recognize algarisms.
SYNOPSIS
use Text::Roman;
print roman(123);
Text::Roman::roman() is a very simple algarism converter. It converts a single integer (in arabic algarisms) at a time to its roman correspondent. The conventional roman numbers goes from 1 up to 3999. MROMANS (milhar romans) range is 1 up to 3999*1000+3999=4002999.
Up to these number we will found symbols as:??????but they do not concern this specific package. There is no concern for mix cases, like Xv, XiiI, as legal roman algarism numbers.
roman($int): return string containing the roman corresponding to the given integer, or if the integer is out of domain...
roman2int($str): return if $str is not roman or return integer if it is.
isroman($str): verify whether the given string is a conventional roman number, if it is return 1; if it is not return 0...
Quite same follows for mroman2int($str) and ismroman($str), except that these functions treat milhar romans.
<<lessSYNOPSIS
use Text::Roman;
print roman(123);
Text::Roman::roman() is a very simple algarism converter. It converts a single integer (in arabic algarisms) at a time to its roman correspondent. The conventional roman numbers goes from 1 up to 3999. MROMANS (milhar romans) range is 1 up to 3999*1000+3999=4002999.
Up to these number we will found symbols as:??????but they do not concern this specific package. There is no concern for mix cases, like Xv, XiiI, as legal roman algarism numbers.
roman($int): return string containing the roman corresponding to the given integer, or if the integer is out of domain...
roman2int($str): return if $str is not roman or return integer if it is.
isroman($str): verify whether the given string is a conventional roman number, if it is return 1; if it is not return 0...
Quite same follows for mroman2int($str) and ismroman($str), except that these functions treat milhar romans.
Download (0.003MB)
Added: 2007-07-27 License: Perl Artistic License Price:
821 downloads
Text::Bloom 1.07
Text::Bloom can evaluate Bloom signature of a set of terms. more>>
Text::Bloom can evaluate Bloom signature of a set of terms.
SYNOPSIS
my $b = Text::Bloom->new();
$b->Compute( qw( foo bar baz ) );
my $sig = $b->WriteToString();
$b->WriteToFile( afile.sig );
my $b2 = Text::Bloom::NewFromFile( afile.sig );
my $b3 = Text::Bloom->new();
$b3->Compute( qw( foo bar barbaz ) );
my $sim = $b->Similarity( $b2 );
my $b4 = Text::Bloom::NewFromString( $sig );
Text::Bloom applies the Bloom filtering technique to the statistical analysis of documents.
The terms in the document are quantized using a base-36 radix representation; each term thus corresponds to an integer in the range 0..p-1, where p is a prime, currently set to the greatest prime less than 2^32.
Each quantized value is mapped to d integers in the range 0..size-1, where size is an integer less than p, currently 2^17, using a family of hash functions, computed by the HashV function.
Each hashed value is used as the index in a large bit vector. Bits corresponding to terms present in the document are set to 1; all other bits are set to 0.
Of course, collisions may cause the same bit to be set twice, by different terms. It follows that, if the document contains n distinct terms, in the resulting bit vector at most n * d bits are set to 1.
The resulting bit string is a very compact representation of the presence/absence of terms in the document, and is therefore characterised as a signature. Moreover, it does not depend on a pre-set dictionary of terms.
The signature may be used for:
testing whether a given set of terms is present in the document,
computing which fraction of terms are common to two documents.
The bit representation may be written to and read from a file. Text::Bloom prepends a header to the bit stream proper; moreover, whenever the package Compress::Zlib is available, the bit vector is compressed, so that disk space requirements are drastically reduced, especially for small documents.
The hash function is obviously a crucial component of the filter; the reference implementation uses a radix representation of strings. Each term must therefore match the regular expression /[0-9a-z]+/.
There are quite a few viable alternatives, which can be pursued by subclassing and redefining the method QuantizeV.
<<lessSYNOPSIS
my $b = Text::Bloom->new();
$b->Compute( qw( foo bar baz ) );
my $sig = $b->WriteToString();
$b->WriteToFile( afile.sig );
my $b2 = Text::Bloom::NewFromFile( afile.sig );
my $b3 = Text::Bloom->new();
$b3->Compute( qw( foo bar barbaz ) );
my $sim = $b->Similarity( $b2 );
my $b4 = Text::Bloom::NewFromString( $sig );
Text::Bloom applies the Bloom filtering technique to the statistical analysis of documents.
The terms in the document are quantized using a base-36 radix representation; each term thus corresponds to an integer in the range 0..p-1, where p is a prime, currently set to the greatest prime less than 2^32.
Each quantized value is mapped to d integers in the range 0..size-1, where size is an integer less than p, currently 2^17, using a family of hash functions, computed by the HashV function.
Each hashed value is used as the index in a large bit vector. Bits corresponding to terms present in the document are set to 1; all other bits are set to 0.
Of course, collisions may cause the same bit to be set twice, by different terms. It follows that, if the document contains n distinct terms, in the resulting bit vector at most n * d bits are set to 1.
The resulting bit string is a very compact representation of the presence/absence of terms in the document, and is therefore characterised as a signature. Moreover, it does not depend on a pre-set dictionary of terms.
The signature may be used for:
testing whether a given set of terms is present in the document,
computing which fraction of terms are common to two documents.
The bit representation may be written to and read from a file. Text::Bloom prepends a header to the bit stream proper; moreover, whenever the package Compress::Zlib is available, the bit vector is compressed, so that disk space requirements are drastically reduced, especially for small documents.
The hash function is obviously a crucial component of the filter; the reference implementation uses a radix representation of strings. Each term must therefore match the regular expression /[0-9a-z]+/.
There are quite a few viable alternatives, which can be pursued by subclassing and redefining the method QuantizeV.
Download (0.013MB)
Added: 2007-08-14 License: Perl Artistic License Price:
801 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above text search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed