Author image thrig
and 1 contributors


Lingua::Awkwords::Parser - parser for awkwords


  my $parser = Lingua::Awkwords::Parser->new;
  my $tree   = $parser->from_string(q{ [VV]^aa });


Parser::MGC subclass that parses awkword patterns. This module will typically be called from Lingua::Awkwords, so need not be used directly.

The specification this code is based on can be found at

though there are differences between this code and the implementation associated with the above documentation; some of these differences are listed as Known Issues; see also comments in the code and the unit tests under the t/ directory of the distribution of this module.



Entry point for Parser::MGC; returns the parsed pattern or fails trying. Code that uses this module will likely instead use the new, from_string, from_file methods imported from Parser::MGC.


Reporting Bugs

Please report any bugs or feature requests to bug-lingua-awkwords at, or through the web interface at

Patches might best be applied towards:

Known Issues

There are known (and doubtless various unknown) incompatibilities with the parser of the original code (the online PHP version). In particular,

  • A filter of [VV]^a"a" in the online version does not filter out aa from the results as of August 2017, though the documentation indicates that it should.

  • Filters differ in other ways; the online version filters out aa if given [VV]^aa but not given VV^aa, though otherwise does treat VV the same as [VV].

  • [a*10*20/b] in the original code parses as a weight of 1020 which is then (with a warning) reduced to the maximum 128. This implementation instead throws an error if multiple weights are parsed, and accepts any (supported by perl) integer above 128.



Lingua::Awkwords::ListOf, Lingua::Awkwords::OneOf, Lingua::Awkwords::String, Lingua::Awkwords::Subpattern



thrig - Jeremy Mates (cpan:JMATES) <jmates at>


Copyright (C) 2017 by Jeremy Mates

This program is distributed under the (Revised) BSD License: