Version: current

# Class phpMorphy

Located at search/code/phpmorphy/common.php

## Methods summary

`public` | # `__construct( mixed $dir, mixed $lang = null, mixed $options = array() )`
`public `phpMorphy_Morphier_Interface`` | # `getCommonMorphier( )` #### Returns ``phpMorphy_Morphier_Interface`` phpMorphy_Morphier_Interface
`public `phpMorphy_Morphier_Interface`` | # `getPredictBySuffixMorphier( )` #### Returns ``phpMorphy_Morphier_Interface`` phpMorphy_Morphier_Interface
`public `phpMorphy_Morphier_Interface`` | # `getPredictByDatabaseMorphier( )` #### Returns ``phpMorphy_Morphier_Interface`` phpMorphy_Morphier_Interface
`public `phpMorphy_Morphier_Bulk`` | # `getBulkMorphier( )` #### Returns ``phpMorphy_Morphier_Bulk`` phpMorphy_Morphier_Bulk
`public string` | # `getEncoding( )` #### Returns `string` string
`public string` | # `getLocale( )` #### Returns `string` string
`public `phpMorphy_GrammemsProvider_Base`` | # `getGrammemsProvider( )` #### Returns ``phpMorphy_GrammemsProvider_Base`` phpMorphy_GrammemsProvider_Base
`public `phpMorphy_GrammemsProvider_Base`` | # `getDefaultGrammemsProvider( )` #### Returns ``phpMorphy_GrammemsProvider_Base`` phpMorphy_GrammemsProvider_Base
`public `phpMorphy_Shm_Cache`` | # `getShmCache( )` #### Returns ``phpMorphy_Shm_Cache`` phpMorphy_Shm_Cache
`public boolean` | # `isLastPredicted( )` #### Returns `boolean` bool
`public` | # `getLastPredictionType( )`
`public `phpMorphy_WordDescriptor_Collection`` | # `findWord( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns ``phpMorphy_WordDescriptor_Collection`` phpMorphy_WordDescriptor_Collection
`public array` | # `lemmatize( mixed $word, mixed $type = `phpMorphy::NORMAL` )` Alias for getBaseForm Alias for getBaseForm #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getBaseForm( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getAllForms( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getPseudoRoot( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getPartOfSpeech( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getAllFormsWithAncodes( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getAllFormsWithGramInfo( mixed $word, mixed $asText = true, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $asText mixed $type - prediction managment $type #### Returns `array` array #### Paradm bool $asText - represent graminfo as text or ancodes
`public array` | # `getAncode( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getGramInfo( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`public array` | # `getGramInfoMergeForms( mixed $word, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word mixed $word - string or array of strings $type mixed $type - prediction managment #### Returns `array` array
`protected` | # `getAnnotForWord( mixed $word, mixed $type )`
`public array` | # `castFormByAncode( string $word, mixed $ancode, mixed $commonAncode = null, boolean $returnOnlyWord = false, mixed $callback = null, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word string $word $ancode mixed $ancode $commonAncode mixed $commonAncode $returnOnlyWord bool $returnOnlyWord $callback mixed $callback $type mixed $type #### Returns `array` array
`public array` | # `castFormByGramInfo( string $word, mixed $partOfSpeech, array $grammems, boolean $returnOnlyWord = false, mixed $callback = null, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word string $word $partOfSpeech mixed $partOfSpeech $grammems array $grammems $returnOnlyWord bool $returnOnlyWord $callback mixed $callback $type mixed $type #### Returns `array` array
`public array` | # `castFormByPattern( string $word, string $patternWord, `phpMorphy_GrammemsProvider_Interface` $grammemsProvider = null, boolean $returnOnlyWord = false, mixed $callback = null, mixed $type = `phpMorphy::NORMAL` )` #### Parameters $word string $word $patternWord string $patternWord $grammemsProvider mixed $essentialGrammems $returnOnlyWord bool $returnOnlyWord $callback mixed $callback $type mixed $type #### Returns `array` array
`protected` | # `processWordsCollection( `phpMorphy_WordDescriptor_Collection` $collection, mixed $asText )`
`protected` | # `invoke( mixed $method, mixed $word, mixed $type )`
`protected` | # `predictWord( mixed $method, mixed $word )`
`protected` | # `initNewStyle( `phpMorphy_FilesBundle` $bundle, mixed $options )`
`protected` | # `createCommonSource( `phpMorphy_FilesBundle` $bundle, mixed $opts )`
`protected` | # `getDbaHandlerName( mixed $name )`
`protected` | # `initOldStyle( `phpMorphy_FilesBundle` $bundle, mixed $options )`
`protected` | # `repairOldOptions( mixed $options )`
`protected` | # `repairSourceOptions( mixed $options )`
`protected` | # `repairOptions( mixed $options )`
`public` | # `__get( mixed $name )`
`public` | # `createGrammemsProvider( )`
`protected` | # `createWordDescriptorSerializer( )`
`protected` | # `createFilesBundle( mixed $dir, mixed $lang )`
`protected` | # `createStorageFactory( mixed $options )`
`protected` | # `createFsa( `phpMorphy_Storage` $storage, mixed $lazy )`
`protected` | # `createGramInfo( `phpMorphy_Storage` $graminfoFile, `phpMorphy_FilesBundle` $bundle )`
`protected` | # `createGramTab( `phpMorphy_Storage` $storage )`
`protected` | # `createAncodesResolverInternal( `phpMorphy_GramTab_Interface` $gramtab, `phpMorphy_FilesBundle` $bundle )`
`protected` | # `createAncodesResolver( `phpMorphy_GramTab_Interface` $gramtab, `phpMorphy_FilesBundle` $bundle, mixed $lazy )`
`protected` | # `createMorphierHelper( `phpMorphy_GramInfo_Interace` $graminfo, `phpMorphy_GramTab_Interface` $gramtab, mixed $graminfoAsText, `phpMorphy_FilesBundle` $bundle )`
`protected` | # `createCommonMorphier( `phpMorphy_Fsa_Interface` $fsa, `phpMorphy_Morphier_Helper` $helper )`
`protected` | # `createBulkMorphier( `phpMorphy_Fsa_Interface` $fsa, `phpMorphy_Morphier_Helper` $helper )`
`protected` | # `createPredictByDbMorphier( `phpMorphy_Fsa_Interface` $fsa, `phpMorphy_Morphier_Helper` $helper )`
`protected` | # `createPredictBySuffixMorphier( `phpMorphy_Fsa_Interface` $fsa, `phpMorphy_Morphier_Helper` $helper )`

### Magic methods summary

## Constants summary

`integer` | `RESOLVE_ANCODES_AS_TEXT` | `0` | #
`integer` | `RESOLVE_ANCODES_AS_DIALING` | `1` | #
`integer` | `RESOLVE_ANCODES_AS_INT` | `2` | #
`integer` | `NORMAL` | `0` | #
`integer` | `IGNORE_PREDICT` | `2` | #
`integer` | `ONLY_PREDICT` | `3` | #
`string` | `PREDICT_BY_NONE` | `'none'` | #
`string` | `PREDICT_BY_SUFFIX` | `'by_suffix'` | #
`string` | `PREDICT_BY_DB` | `'by_db'` | #

## Properties summary

`protected mixed` | $storage_factory | #
`protected mixed` | $common_fsa | #
`protected mixed` | $common_source | #
`protected mixed` | $predict_fsa | #
`protected mixed` | $options | #
`protected mixed` | $helper | #
`protected mixed` | $last_prediction_type | #

[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. -