Version: current

# Interface phpMorphy_Fsa_Interface

This file is part of phpMorphy library

Copyright c 2007-2008 Kamaev Vladimir <heromantor@users.sourceforge.net>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

### Direct known implementers

`phpMorphy_Fsa`, `phpMorphy_Fsa_Decorator`

### Indirect known implementers

`phpMorphy_Fsa_Proxy`, `phpMorphy_Fsa_Sparse_File`, `phpMorphy_Fsa_Sparse_Mem`, `phpMorphy_Fsa_Sparse_Shm`, `phpMorphy_Fsa_Tree_File`, `phpMorphy_Fsa_Tree_Mem`, `phpMorphy_Fsa_Tree_Shm`

Located at search/code/phpmorphy/fsa/fsa.php

## Methods summary

`public array` | # `getRootTrans( )` Return root transition of fsa Return root transition of fsa #### Returns `array` array
`public mixed` | # `getRootState( )` Returns root state object Returns root state object #### Returns `mixed`
`public array` | # `getAlphabet( )` Returns alphabet i.e. all chars used in automat Returns alphabet i.e. all chars used in automat #### Returns `array` array
`public string` | # `getAnnot( array $trans )` Return annotation for given transition(if annotation flag is set for given trans) Return annotation for given transition(if annotation flag is set for given trans) #### Parameters $trans array $trans #### Returns `string` string
`public boolean` | # `walk( mixed $trans, string $word, boolean $readAnnot = true )` Find word in automat Find word in automat #### Parameters $trans mixed $trans starting transition $word string $word $readAnnot bool $readAnnot read annot or simple check if word exists in automat #### Returns `boolean` TRUE if word is found, FALSE otherwise
`public` | # `collect( mixed $startNode, mixed $callback, boolean $readAnnot = true, string $path = '' )` Traverse automat and collect words For each found words $callback function invoked with follow arguments: call_user_func($callback, $word, $annot) when $readAnnot is FALSE then $annot arg is always NULL Traverse automat and collect words For each found words $callback function invoked with follow arguments: call_user_func($callback, $word, $annot) when $readAnnot is FALSE then $annot arg is always NULL #### Parameters $startNode mixed $startNode $callback mixed $callback callback function(in php format callback i.e. string or array(obj, method) or array(class, method) $readAnnot bool $readAnnot read annot $path string $path string to be append to all words
`public array` | # `readState( integer $index )` Read state at given index Read state at given index #### Parameters $index int $index #### Returns `array` array
`public array` | # `unpackTranses( mixed $rawTranses )` Unpack transition from binary form to array Unpack transition from binary form to array #### Parameters $rawTranses mixed $rawTranses may be array for convert more than one transitions #### Returns `array` array

### Magic methods summary

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -