matching
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 983
JavaMatch 0.2
JavaMatch provides a match engine for Java data structures. more>>
JavaMatch provides a match engine for Java data structures.
JavaMatch is an engine that can search inside runtime Java data structures and look for objects that best match the criteria that you specify.
JavaMatch is a generic match engine, not targeted at a specific domain. It can be applied to any runtime data structure, and the extensive query mechanism allows for highly customizable tuning of your searches.
JavaMatch can be integrated with object- relational mapping tools. This allows you to match inside databases.
JavaMatchs functionality compared to "normal" database searching can be described by using an analogy:
If you search for something in Google, you dont just see the pages that exactly match your search query, youll also get the results that best match the search query (unless you use the "+"-syntax).
JavaMatch provides this Google-like functionality, but then applied to a Java data structure: It looks for the objects that best match the query: Out of the entire data set, it returns the top-10 (or more, if you specify so) of the best matching objects.
<<lessJavaMatch is an engine that can search inside runtime Java data structures and look for objects that best match the criteria that you specify.
JavaMatch is a generic match engine, not targeted at a specific domain. It can be applied to any runtime data structure, and the extensive query mechanism allows for highly customizable tuning of your searches.
JavaMatch can be integrated with object- relational mapping tools. This allows you to match inside databases.
JavaMatchs functionality compared to "normal" database searching can be described by using an analogy:
If you search for something in Google, you dont just see the pages that exactly match your search query, youll also get the results that best match the search query (unless you use the "+"-syntax).
JavaMatch provides this Google-like functionality, but then applied to a Java data structure: It looks for the objects that best match the query: Out of the entire data set, it returns the top-10 (or more, if you specify so) of the best matching objects.
Download (1.4MB)
Added: 2007-02-16 License: LGPL (GNU Lesser General Public License) Price:
980 downloads
Net::ACL::Match::IP 0.07
Net::ACL::Match::IP is a class matching IP addresses against an IP or network. more>>
Net::ACL::Match::IP is a class matching IP addresses against an IP or network.
SYNOPSIS
use Net::ACL::Match::IP;
# Constructor
$match = new Net::ACL::Match::IP(1,10.0.0.0/8);
# Accessor Methods
$netmaskobj = $match->net($netmaskobj);
$netmaskobj = $match->net($net);
$index = $match->index($index);
$rc = $match->match($ip);
__top
This module is just a wrapper of the Net::Netmask module to allow it to operate automatically with Net::ACL::Rule.
<<lessSYNOPSIS
use Net::ACL::Match::IP;
# Constructor
$match = new Net::ACL::Match::IP(1,10.0.0.0/8);
# Accessor Methods
$netmaskobj = $match->net($netmaskobj);
$netmaskobj = $match->net($net);
$index = $match->index($index);
$rc = $match->match($ip);
__top
This module is just a wrapper of the Net::Netmask module to allow it to operate automatically with Net::ACL::Rule.
Download (0.028MB)
Added: 2006-07-27 License: Perl Artistic License Price:
1187 downloads
hachoir-regex 1.0
hachoir-regex application is regex manipulation Python library. more>>
hachoir-regex application is regex manipulation Python library. Its used by hachoir-subfile for fast pattern matching (find file header).
Examples
Regex creation
>>> from hachoir_core.regex import parse, createString
>>> createString("bike") | createString("motor")
< RegexOr (bike|motor) >
>>> createString("big ") + createString("bike")
< RegexString big bike >
>>> r=parse((cat|horse))
>>> r.minLength(), r.maxLength()
(3, 5)
Optimizations
>>> from hachoir_core.regex import parse, createString
>>> parse("(ma|mb|mc)")
< RegexAnd m[a-c] >
>>> createString("moto") | parse("mot.")
< RegexAnd mot. >
Pattern matching
from hachoir_core.regex import PatternMatching
p = PatternMatching()
p.addString("un", 1)
p.addString("deux", 2)
p.addRegex("(trois|three)", 3)
for start, end, item in p.search("un deux trois"):
print "%r at %s: user=%r" % (item, start, item.user)
find
< StringPattern un > at 0: user=1
< StringPattern deux > at 3: user=2
< RegexPattern t(rois|hree) > at 8: user=3
Enhancements:
- This version supports most regex structures and a lot of regex optimization, but keeps regex order.
<<lessExamples
Regex creation
>>> from hachoir_core.regex import parse, createString
>>> createString("bike") | createString("motor")
< RegexOr (bike|motor) >
>>> createString("big ") + createString("bike")
< RegexString big bike >
>>> r=parse((cat|horse))
>>> r.minLength(), r.maxLength()
(3, 5)
Optimizations
>>> from hachoir_core.regex import parse, createString
>>> parse("(ma|mb|mc)")
< RegexAnd m[a-c] >
>>> createString("moto") | parse("mot.")
< RegexAnd mot. >
Pattern matching
from hachoir_core.regex import PatternMatching
p = PatternMatching()
p.addString("un", 1)
p.addString("deux", 2)
p.addRegex("(trois|three)", 3)
for start, end, item in p.search("un deux trois"):
print "%r at %s: user=%r" % (item, start, item.user)
find
< StringPattern un > at 0: user=1
< StringPattern deux > at 3: user=2
< RegexPattern t(rois|hree) > at 8: user=3
Enhancements:
- This version supports most regex structures and a lot of regex optimization, but keeps regex order.
Download (0.020MB)
Added: 2007-07-03 License: GPL (GNU General Public License) Price:
844 downloads
AbsoluteMeeting 1.0
AbsoluteMeeting is a people matching and dating engine. more>>
AbsoluteMeeting is a people matching and dating engine. It lets people register (with their photos), then search for friends/partners. It includes a PayPal interface.
Quick Install:
- Install Apache with PHP
- Postgresql version > 7.3
- su - postgres
createdb rateme
psql rateme < rateme_schema.sql
psql rateme < rateme_dump_tables.sql
- create virtual apache host.
- point browser to http://yourname/admin/ , user=admin, passowrd=admin
<<lessQuick Install:
- Install Apache with PHP
- Postgresql version > 7.3
- su - postgres
createdb rateme
psql rateme < rateme_schema.sql
psql rateme < rateme_dump_tables.sql
- create virtual apache host.
- point browser to http://yourname/admin/ , user=admin, passowrd=admin
Download (0.17MB)
Added: 2006-06-23 License: GPL (GNU General Public License) Price:
1219 downloads
Batchput 0.9.4
Batchput transfers files from a local directory, matching the regex you specify, to an FTP server. more>>
Batchput transfers files from a local directory, matching the regex you specify, to an FTP server. Written in Python, the program is focused on doing this safely and efficiently, using per-directory locking and a single ftp session.
Batchput was originally written as a program to transfer text files containing business transactions from one system to another. With this in mind, it is not a useful tool for doing things like mirroring a directory etc. If thats what you want to do, there are many good programs
out there that will perform nicely.
To use batchput, simply copy the batchput Python script to somewhere
useful and call it from, for example, crontab.
Enhancements:
- Added --ftp-ascii-mode option to support ASCII mode transfer.
- Added --auth-netrc-* options for dealing with netrc files. Batchput now allows username/password either through the URL, through netrc files, or through forced keyboard / terminal input.
<<lessBatchput was originally written as a program to transfer text files containing business transactions from one system to another. With this in mind, it is not a useful tool for doing things like mirroring a directory etc. If thats what you want to do, there are many good programs
out there that will perform nicely.
To use batchput, simply copy the batchput Python script to somewhere
useful and call it from, for example, crontab.
Enhancements:
- Added --ftp-ascii-mode option to support ASCII mode transfer.
- Added --auth-netrc-* options for dealing with netrc files. Batchput now allows username/password either through the URL, through netrc files, or through forced keyboard / terminal input.
Download (0.012MB)
Added: 2007-03-24 License: GPL (GNU General Public License) Price:
944 downloads
Mptn 0.3.0
Mptn is a library providing a pattern matching mechanism similar to regular expressions. more>>
Mptn project is a library providing a pattern matching mechanism similar to regular expressions, but with several differences making it more suitable for building a morphological analyzer.
Differences are:
- The whole string is matched against the pattern; thus the emphasis is on finding appropriate variable assignments, not on quick search. (This also means mptns will generally work slower than regexps, since they cannot in general be described by finite state automata)
- All the possible variable assignments are iterated over, not just one.
- Named variables make patterns more readable. In addition, a pattern may be associated with a variable name, restricting the possible values of the variable. Thus, you can use, for example, {c1}{v}{c2}? to match a syllable of CV/CVC structure (consonant-vowel-consonant).
- "Matcher" mechanism to extend the matching process with arbitrary procedures.
<<lessDifferences are:
- The whole string is matched against the pattern; thus the emphasis is on finding appropriate variable assignments, not on quick search. (This also means mptns will generally work slower than regexps, since they cannot in general be described by finite state automata)
- All the possible variable assignments are iterated over, not just one.
- Named variables make patterns more readable. In addition, a pattern may be associated with a variable name, restricting the possible values of the variable. Thus, you can use, for example, {c1}{v}{c2}? to match a syllable of CV/CVC structure (consonant-vowel-consonant).
- "Matcher" mechanism to extend the matching process with arbitrary procedures.
Download (0.10MB)
Added: 2006-08-28 License: LGPL (GNU Lesser General Public License) Price:
1152 downloads
Markup::MatchTree 1.0.0
Markup::MatchTree is a Perl module for building trees to be compared to Markup::Trees. more>>
Markup::MatchTree is a Perl module for building trees to be compared to Markup::Trees.
SYNOPSIS
use Markup::MatchTree;
my $match_tree = Markup::MatchTree->new( no_squash_whitespace => @same_as_I_used_for_Markup__Tree);
$match_tree->parse_file (http://localhost/site_template.xml);
Most likely you wont need to use this module explicitly unless you are doing some custom matching/parsing/extracting. Mainly this will be used by the upcoming Markup::Content module.
See Markup::Tree for a description of the methods. The only difference is MatchTree dosent accpet no_indent as an argument. no_squash_whitespace should be the same value that was used for Markup::Tree.
<<lessSYNOPSIS
use Markup::MatchTree;
my $match_tree = Markup::MatchTree->new( no_squash_whitespace => @same_as_I_used_for_Markup__Tree);
$match_tree->parse_file (http://localhost/site_template.xml);
Most likely you wont need to use this module explicitly unless you are doing some custom matching/parsing/extracting. Mainly this will be used by the upcoming Markup::Content module.
See Markup::Tree for a description of the methods. The only difference is MatchTree dosent accpet no_indent as an argument. no_squash_whitespace should be the same value that was used for Markup::Tree.
Download (0.003MB)
Added: 2006-09-21 License: Perl Artistic License Price:
1128 downloads
KABC Client 0.8.1
KABC Client is a command line tool that provides access to the KDE address book. more>>
KABC Client is a command line tool that provides access to the KDE address book, which is also used by applications like KAddressBook.
It can take its input from either the command line or through standard input, allowing its use in Unix shell pipe and filter constructs. Input and output text is interpreted and formatted by filters.
kabcclient can perform the following operations:
- List: --list or -L
Write all contacts of the addressbook to stdout
- Search: --search or -S
Search for contacts matching the programs input
- Add: --add or -A
Add new contacts to the addressbook
- Remove: --remove or -R
Remove contacts matching the programs input from the addressbook
- Merge: --merge or -M
Add data from the programs input to matching contacts in the addressbook
Enhancements:
- Adding installation instructions and build files for creating Debian packages.
- No changes to the program itself!
<<lessIt can take its input from either the command line or through standard input, allowing its use in Unix shell pipe and filter constructs. Input and output text is interpreted and formatted by filters.
kabcclient can perform the following operations:
- List: --list or -L
Write all contacts of the addressbook to stdout
- Search: --search or -S
Search for contacts matching the programs input
- Add: --add or -A
Add new contacts to the addressbook
- Remove: --remove or -R
Remove contacts matching the programs input from the addressbook
- Merge: --merge or -M
Add data from the programs input to matching contacts in the addressbook
Enhancements:
- Adding installation instructions and build files for creating Debian packages.
- No changes to the program itself!
Download (0.25MB)
Added: 2005-08-31 License: GPL (GNU General Public License) Price:
1514 downloads
Fontconfig 2.3.91
Fontconfig is a library for font customization and configuration. more>>
Fontconfig is a library designed to provide system-wide font configuration, customization and application access.
The configuration module consists of the FcConfig datatype, libexpat and FcConfigParse which walks over an XML tree and ammends a configuration with data found within.
From an external perspective, configuration of the library consists of generating a valid XML tree and feeding that to FcConfigParse.
The only other mechanism provided to applications for changing the running configuration is to add fonts and directories to the list of application-provided font files.
The intent is to make font configurations relatively static, and shared by as many applications as possible. It is hoped that this will lead to more stable font selection when passing names from one application to another.
XML was chosen as a configuration file format because it provides a format which is easy for external agents to edit while retaining the correct structure and syntax.
Font configuration is separate from font matching; applications needing to do their own matching can access the available fonts from the library and perform private matching.
The intent is to permit applications to pick and choose appropriate functionality from the library instead of forcing them to choose between this library and a private configuration mechanism.
The hope is that this will ensure that configuration of fonts for all applications can be centralized in one place. Centralizing font configuration will simplify and regularize font installation and customization.
<<lessThe configuration module consists of the FcConfig datatype, libexpat and FcConfigParse which walks over an XML tree and ammends a configuration with data found within.
From an external perspective, configuration of the library consists of generating a valid XML tree and feeding that to FcConfigParse.
The only other mechanism provided to applications for changing the running configuration is to add fonts and directories to the list of application-provided font files.
The intent is to make font configurations relatively static, and shared by as many applications as possible. It is hoped that this will lead to more stable font selection when passing names from one application to another.
XML was chosen as a configuration file format because it provides a format which is easy for external agents to edit while retaining the correct structure and syntax.
Font configuration is separate from font matching; applications needing to do their own matching can access the available fonts from the library and perform private matching.
The intent is to permit applications to pick and choose appropriate functionality from the library instead of forcing them to choose between this library and a private configuration mechanism.
The hope is that this will ensure that configuration of fonts for all applications can be centralized in one place. Centralizing font configuration will simplify and regularize font installation and customization.
Download (0.97MB)
Added: 2005-10-18 License: GPL (GNU General Public License) Price:
1468 downloads
mairix 0.21
mairix is a tool for indexing and searching email messages stored in Maildir, MH, or mbox folders. more>>
mairix is a tool for indexing and searching email messages stored in Maildir, MH, or mbox folders. The index contains a map of which words occur in which parts of which messages.
Searches on this index are fast and generate symlinks to the matching messages in a new Maildir or MH folder, or copies of matching messages in an mbox folder, which can be browsed normally in a mail client.
Main features:
- Indexing is fast. It runs incrementally on new messages - any particular message only gets scanned once in the lifetime of the index file.
- The search mode populates a "virtual" maildir (or MH) folder with symlinks which point to the real messages. This folder can be opened as usual in your mail program. (Note, if messages are in mbox folders, copies are made. Similarly if the virtual folder has mbox format, it is filled with copies of the matched messages.)
- The search mode is very fast.
- Indexing and searching works on the basis of words. The index file tabulates which words occur in which parts (particular headers + body) of which messages.
Enhancements:
- A handful of bugs were fixed: crashes in the name/value parser, handling of . and .. in MH folders, broken mbox folders, and indexing when the database only contained a single message.
<<lessSearches on this index are fast and generate symlinks to the matching messages in a new Maildir or MH folder, or copies of matching messages in an mbox folder, which can be browsed normally in a mail client.
Main features:
- Indexing is fast. It runs incrementally on new messages - any particular message only gets scanned once in the lifetime of the index file.
- The search mode populates a "virtual" maildir (or MH) folder with symlinks which point to the real messages. This folder can be opened as usual in your mail program. (Note, if messages are in mbox folders, copies are made. Similarly if the virtual folder has mbox format, it is filled with copies of the matched messages.)
- The search mode is very fast.
- Indexing and searching works on the basis of words. The index file tabulates which words occur in which parts (particular headers + body) of which messages.
Enhancements:
- A handful of bugs were fixed: crashes in the name/value parser, handling of . and .. in MH folders, broken mbox folders, and indexing when the database only contained a single message.
Download (0.15MB)
Added: 2007-06-25 License: GPL (GNU General Public License) Price:
851 downloads
Pathological 1.1.3
Pathological is an enriched clone of the game Logical by Rainbow Arts. more>>
Pathological is an enriched clone of the game "Logical" by Rainbow Arts. To solve a level, fill each wheel with four marbles of matching color.
Various board elements such as teleporters, switches, filters, etc., make the game interesting and challenging. New levels can be created using your favorite text editor.
Main features:
- Sharp 800x600 graphics
- 50 diverse and challenging levels (more to come...)
- A cool 6-minute ambient soundtrack by an award-winning musician
<<lessVarious board elements such as teleporters, switches, filters, etc., make the game interesting and challenging. New levels can be created using your favorite text editor.
Main features:
- Sharp 800x600 graphics
- 50 diverse and challenging levels (more to come...)
- A cool 6-minute ambient soundtrack by an award-winning musician
Download (6.3MB)
Added: 2005-08-16 License: GPL (GNU General Public License) Price:
1531 downloads
The Linux Memory Game 0.6c
The Linux Memory Game project is a childrens (and adults) game based on the card game. more>>
The Linux Memory Game project is a childrens (and adults) game based on the card game.
The Linux Memory Game is an X11 game using GTK+ library for children ages 3 and up. It is a lot more than the card game "Memory".
It has five skill levels, the higher ones are challenging to adults as well. Additionally, one can choose from the menu to match 2 cards or 3 cards, or match different cards.
This last "different card" mode can be a very good teaching tool for teaching languages, concepts, or association.
Main features:
- Extensible - add new images yourself without having to make changes to the program.
- Five skill levels appropriate for the youngest and the ones with the best brains.
- Can play two card matching or three card matching (more challenging!)
- Can set to match different cards. This can be used with apropriately designed pictures to teach children (or adults) words, concepts, or another language.
Enhancements:
- Fixed overflow bug in pixmaps_jump.
<<lessThe Linux Memory Game is an X11 game using GTK+ library for children ages 3 and up. It is a lot more than the card game "Memory".
It has five skill levels, the higher ones are challenging to adults as well. Additionally, one can choose from the menu to match 2 cards or 3 cards, or match different cards.
This last "different card" mode can be a very good teaching tool for teaching languages, concepts, or association.
Main features:
- Extensible - add new images yourself without having to make changes to the program.
- Five skill levels appropriate for the youngest and the ones with the best brains.
- Can play two card matching or three card matching (more challenging!)
- Can set to match different cards. This can be used with apropriately designed pictures to teach children (or adults) words, concepts, or another language.
Enhancements:
- Fixed overflow bug in pixmaps_jump.
Download (0.10MB)
Added: 2006-11-15 License: GPL (GNU General Public License) Price:
1073 downloads
Array::PatternMatcher 0.04
Array::PatternMatcher is a pattern matching for arrays. more>>
Array::PatternMatcher is a pattern matching for arrays.
SYNOPSIS
This section inlines the entire test suite. Please excuse the ok()s.
use Array::PatternMatcher;
Matching logical variables to input stream
# 1 - simple match of logical variable to input
my $pattern = AGE ;
my $input = 969 ;
my $result = pat_match ($pattern, $input, {} ) ;
ok($result->{AGE}, 969) ;
# 2 - if binding exists, it must equal the input
$input = 12;
my $new_result = pat_match ($pattern, $input, $result) ;
ok(!defined($new_result)) ;
# 3 - bind the pattern logical variables to the input list
$pattern = [qw(X Y)] ;
$input = [ 77, 45 ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok($result->{X}, 77) ;
Matching segments (quantifying) portions of the input stream
# 1
{
my $pattern = [a, [qw(X *)], d] ;
my $input = [a, b, c, d] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("@{$result->{X}}","b c") ;
}
# 2
{
my $pattern = [a, [qw(X *)], [qw(Y *)], d] ;
my $input = [a, b, c, d] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("@{$result->{Y}}","b c") ;
}
# 3
{
my $pattern = [a, [qw(X +)], d] ;
my $input = [a, b, c, d] ;
ok ("@{$result->{X}}","b c") ;
}
# 4
{
my $pattern = [ a, [qw(X ?)], c ] ;
my $input = [ a, b, c ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("$result->{X}","b") ;
}
# 5
{
my $pattern = [ qw(X OP Y is Z),
[
sub { "($_->{X} $_->{OP} $_->{Y}) == $_->{Z}" },
IF?
]
] ;
my $input = [qw(3 + 4 is 7) ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ($result) ;
}
Single-matching:
Take a single input and a series of patterns and decide which pattern
matches the input:
# 1 - Here all input patterns must match the input
{
my @pattern ;
push @pattern, [ qw(X Y) ] ;
push @pattern, [ qw(22 Z ) ] ;
push @pattern, [ qw(M 33) ] ;
my $input = [ qw(22 33) ] ;
my $meta_pattern = [ AND?, @pattern ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($meta_pattern, $input, {} ) ;
ok ($result->{Z},33) ;
}
# 2 - Here, any one of the patterns must match the input
{
my @pattern ;
push @pattern, [ qw(99 22) ] ;
push @pattern, [ qw(33 22) ] ;
push @pattern, [ qw(44 3) ] ;
push @pattern, [ qw(22 Z) ] ;
my $input = [ qw(22 33) ] ;
my $meta_pattern = [ OR?, @pattern ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($meta_pattern, $input, {} ) ;
ok ($result->{Z},33) ;
}
# 3 - Here, none of the patterns must match the input
{
my @pattern ;
push @pattern, [ qw(99 22) ] ;
push @pattern, [ qw(33 22) ] ;
push @pattern, [ qw(44 3) ] ;
push @pattern, [ qw(22 Z) ] ;
my $input = [ qw(22 33) ] ;
my $meta_pattern = [ NOT?, @pattern ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($meta_pattern, $input, {} ) ;
ok (scalar keys %$result == 0) ;
}
# 4 - here the input must satisfy the predicate
{
sub numberp { $_[0] =~ /d+/ }
my $pattern = [ qw(X age), [qw(IS? N), νmberp] ] ;
my $input = [ qw(Mary age), thirty-four ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($pattern, $input, {} ) ;
ok (!defined($result));
}
# 5 - same thing, but this time a failing result ---
# not undef because it is the return val of numberp
{
sub numberp { $_[0] =~ /d+/ }
my $pattern = [ qw(X age), [qw(IS? N), νmberp] ] ;
my $input = [ qw(Mary age), 34 ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ($result->{N},34) ;
}
Segment-matching:
Match a chunk of the input stream using *, +, ?
# 1 - * is greedy in this case, but not with 2 consecutve * patterns
{
my $pattern = [a, [qw(X *)], d] ;
my $input = [a, b, c, d] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "X*RETVAL: %s", Data::Dumper::Dumper($result) ;
ok ("@{$result->{X}}","b c") ;
}
# 2 - X* gets nothing, Y* gets all it can:
{
my $pattern = [a, [qw(X *)], [qw(Y *)], d] ;
my $input = [a, b, c, d] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "X*Y*RETVAL: %s", Data::Dumper::Dumper($result) ;
ok ("@{$result->{Y}}","b c") ;
}
# 3 - samething , but require at least one match for X
{
my $pattern = [a, [qw(X +)], d] ;
my $input = [a, b, c, d] ;
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "RETVAL: @{$result->{X}}" ;
ok ("@{$result->{X}}","b c") ;
}
# 4 - require 0 or 1 match for X
{
my $pattern = [ a, [qw(X ?)], c ] ;
my $input = [ a, b, c ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("$result->{X}","b") ;
}
# 5 - evaluate a sub on the fly after match
{
my $pattern = [ qw(X OP Y is Z),
[
sub { "($_->{X} $_->{OP} $_->{Y}) == $_->{Z}" },
IF?
]
] ;
my $input = [qw(3 + 4 is 7) ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ($result) ;
}
# --- 6 same thing, but fail
{
my $pattern = [ qw(X OP Y is Z),
[
sub { "($_->{X} $_->{OP} $_->{Y}) == $_->{Z}" },
IF?
]
] ;
my $input = [qw(3 + 4 is 8) ] ;
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "IF_RETVAL2: *%s*", Data::Dumper::Dumper($result);
ok ($result eq ) ;
}
<<lessSYNOPSIS
This section inlines the entire test suite. Please excuse the ok()s.
use Array::PatternMatcher;
Matching logical variables to input stream
# 1 - simple match of logical variable to input
my $pattern = AGE ;
my $input = 969 ;
my $result = pat_match ($pattern, $input, {} ) ;
ok($result->{AGE}, 969) ;
# 2 - if binding exists, it must equal the input
$input = 12;
my $new_result = pat_match ($pattern, $input, $result) ;
ok(!defined($new_result)) ;
# 3 - bind the pattern logical variables to the input list
$pattern = [qw(X Y)] ;
$input = [ 77, 45 ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok($result->{X}, 77) ;
Matching segments (quantifying) portions of the input stream
# 1
{
my $pattern = [a, [qw(X *)], d] ;
my $input = [a, b, c, d] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("@{$result->{X}}","b c") ;
}
# 2
{
my $pattern = [a, [qw(X *)], [qw(Y *)], d] ;
my $input = [a, b, c, d] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("@{$result->{Y}}","b c") ;
}
# 3
{
my $pattern = [a, [qw(X +)], d] ;
my $input = [a, b, c, d] ;
ok ("@{$result->{X}}","b c") ;
}
# 4
{
my $pattern = [ a, [qw(X ?)], c ] ;
my $input = [ a, b, c ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("$result->{X}","b") ;
}
# 5
{
my $pattern = [ qw(X OP Y is Z),
[
sub { "($_->{X} $_->{OP} $_->{Y}) == $_->{Z}" },
IF?
]
] ;
my $input = [qw(3 + 4 is 7) ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ($result) ;
}
Single-matching:
Take a single input and a series of patterns and decide which pattern
matches the input:
# 1 - Here all input patterns must match the input
{
my @pattern ;
push @pattern, [ qw(X Y) ] ;
push @pattern, [ qw(22 Z ) ] ;
push @pattern, [ qw(M 33) ] ;
my $input = [ qw(22 33) ] ;
my $meta_pattern = [ AND?, @pattern ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($meta_pattern, $input, {} ) ;
ok ($result->{Z},33) ;
}
# 2 - Here, any one of the patterns must match the input
{
my @pattern ;
push @pattern, [ qw(99 22) ] ;
push @pattern, [ qw(33 22) ] ;
push @pattern, [ qw(44 3) ] ;
push @pattern, [ qw(22 Z) ] ;
my $input = [ qw(22 33) ] ;
my $meta_pattern = [ OR?, @pattern ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($meta_pattern, $input, {} ) ;
ok ($result->{Z},33) ;
}
# 3 - Here, none of the patterns must match the input
{
my @pattern ;
push @pattern, [ qw(99 22) ] ;
push @pattern, [ qw(33 22) ] ;
push @pattern, [ qw(44 3) ] ;
push @pattern, [ qw(22 Z) ] ;
my $input = [ qw(22 33) ] ;
my $meta_pattern = [ NOT?, @pattern ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($meta_pattern, $input, {} ) ;
ok (scalar keys %$result == 0) ;
}
# 4 - here the input must satisfy the predicate
{
sub numberp { $_[0] =~ /d+/ }
my $pattern = [ qw(X age), [qw(IS? N), νmberp] ] ;
my $input = [ qw(Mary age), thirty-four ] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($pattern, $input, {} ) ;
ok (!defined($result));
}
# 5 - same thing, but this time a failing result ---
# not undef because it is the return val of numberp
{
sub numberp { $_[0] =~ /d+/ }
my $pattern = [ qw(X age), [qw(IS? N), νmberp] ] ;
my $input = [ qw(Mary age), 34 ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ($result->{N},34) ;
}
Segment-matching:
Match a chunk of the input stream using *, +, ?
# 1 - * is greedy in this case, but not with 2 consecutve * patterns
{
my $pattern = [a, [qw(X *)], d] ;
my $input = [a, b, c, d] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "X*RETVAL: %s", Data::Dumper::Dumper($result) ;
ok ("@{$result->{X}}","b c") ;
}
# 2 - X* gets nothing, Y* gets all it can:
{
my $pattern = [a, [qw(X *)], [qw(Y *)], d] ;
my $input = [a, b, c, d] ;
# if no bindings, add a binding between pattern and input
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "X*Y*RETVAL: %s", Data::Dumper::Dumper($result) ;
ok ("@{$result->{Y}}","b c") ;
}
# 3 - samething , but require at least one match for X
{
my $pattern = [a, [qw(X +)], d] ;
my $input = [a, b, c, d] ;
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "RETVAL: @{$result->{X}}" ;
ok ("@{$result->{X}}","b c") ;
}
# 4 - require 0 or 1 match for X
{
my $pattern = [ a, [qw(X ?)], c ] ;
my $input = [ a, b, c ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ("$result->{X}","b") ;
}
# 5 - evaluate a sub on the fly after match
{
my $pattern = [ qw(X OP Y is Z),
[
sub { "($_->{X} $_->{OP} $_->{Y}) == $_->{Z}" },
IF?
]
] ;
my $input = [qw(3 + 4 is 7) ] ;
my $result = pat_match ($pattern, $input, {} ) ;
ok ($result) ;
}
# --- 6 same thing, but fail
{
my $pattern = [ qw(X OP Y is Z),
[
sub { "($_->{X} $_->{OP} $_->{Y}) == $_->{Z}" },
IF?
]
] ;
my $input = [qw(3 + 4 is 8) ] ;
my $result = pat_match ($pattern, $input, {} ) ;
warn sprintf "IF_RETVAL2: *%s*", Data::Dumper::Dumper($result);
ok ($result eq ) ;
}
Download (0.006MB)
Added: 2007-07-12 License: Perl Artistic License Price:
836 downloads
AdCensor 0.11
Ad Censor filters annoying ads by matching requested urls with a blacklist and checking the HTML code for suspicious tags. more>>
Ad Censor filters annoying ads by matching requested urls with a blacklist and checking the HTML code for suspicious tags.
Main features:
- Checks HTML data from HTTP connection for user defined patterns (e.g. ads) and deletes them.
- Works with any Browser (even without) because it is a proxy.
- Works even over a HTTP proxy.
- Has an easy to use GUI config editor.
- Filters can be defined with perl regex.
- Can also block cookies.
<<lessMain features:
- Checks HTML data from HTTP connection for user defined patterns (e.g. ads) and deletes them.
- Works with any Browser (even without) because it is a proxy.
- Works even over a HTTP proxy.
- Has an easy to use GUI config editor.
- Filters can be defined with perl regex.
- Can also block cookies.
Download (MB)
Added: 2005-10-06 License: GPL (GNU General Public License) Price:
1478 downloads
Duplicate Music Matcher 2.3
Duplicate Music Matcher is a script to quickly find duplicate MP3 files based on letter matching. more>>
Duplicate Music Matcher is a script to quickly find duplicate MP3 files based on letter matching.
Duplicate Music Matcher is helpful for weeding out duplicates that may not be of the same encoding, format, or even the same filename.
Enhancements:
- pymad pyvorbis python-flac deps were all removed in favor of mutagen
- GUI code was updated (no more SimpleGladeApp)
- Delete key have been bound in the GUI
- More accurate matching for ogg and flac files
- The filename column is now resizable
- The GUI play and stop buttons now use audacious.FLAC should now also give a length value
- Some oggs might have a huge bitrate value due to a bug in mutagen.
<<lessDuplicate Music Matcher is helpful for weeding out duplicates that may not be of the same encoding, format, or even the same filename.
Enhancements:
- pymad pyvorbis python-flac deps were all removed in favor of mutagen
- GUI code was updated (no more SimpleGladeApp)
- Delete key have been bound in the GUI
- More accurate matching for ogg and flac files
- The filename column is now resizable
- The GUI play and stop buttons now use audacious.FLAC should now also give a length value
- Some oggs might have a huge bitrate value due to a bug in mutagen.
Download (0.010MB)
Added: 2007-04-04 License: GPL (GNU General Public License) Price:
942 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 matching 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