An open API service indexing awesome lists of open source software.

https://github.com/fnl/libfsmg

A finite state machine library for pattern matching on generic types in Java sequence containers.
https://github.com/fnl/libfsmg

Last synced: 24 days ago
JSON representation

A finite state machine library for pattern matching on generic types in Java sequence containers.

Awesome Lists containing this project

README

          

=======
libfsmg
=======

Synopsis
--------

A generic finite state machine library.

Overview
--------

This library provides two means of pattern matching: Knuth-Morris-Pratt (KMP;
for the Iterator interface) and Boyer-Moore (BM; for the List interface)
algorithm-based **exact matchers** (i.e., two DFAs) and a weighted
backtracking-based **pattern matcher** using dynamic programming that provides
Kleene closures (``*``, ``+``, and ``?``) and capture groups (``(`` ... ``)``)
for the matched patterns (i.e., a NFA). The entire library is implemented
using *generics* (i.e., requires Java 1.5 and beyond), so that any sequence of
types may be used (arrays, Lists and any sequence that provides the Iterator
protocol). The APIs are implemented as close as possible to Java's own Pattern
and Matcher APIs in ``util.regex``.

Usage
-----

See the
`Java API `_
index page of this library for general information,
or the specific notes on using an
`ExactMatcher `_
(a BM List matcher), the
`ExactScanner `_
(a KMP Iterator scanner), and on implementing the NFA
`Pattern `_
matcher. For an example of using the pattern matcher, refer to the ``txtfnnl``
`project `_
to find examples of the
`Transition interface `_
, the
`Pattern implementation `_
, and an actual
`CFG pattern compiler `_
.

Installation
------------

Clone from github ( ``git clone git://github.com/fnl/libfsmg.git`` ),
and run ``mvn install`` in the newly created ``libfsmg`` directory.

License, Author and Copyright Notice
------------------------------------

**libfsmg** is free, open source software provided via a
`Apache 2.0 License `_ -
see ``LICENSE.txt`` in this directory for details.

Copyright 2012, 2013 - Florian Leitner (fnl). All rights reserved.