Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • Address
  • AddSubsiteTask
  • Announcement
  • AnnouncementDecorator
  • AnnouncementHolder
  • AssociatedFolderDecorator
  • AttachedFiles
  • AudioPhpCaptcha
  • AutoCompleteField
  • BaseMediawebImportParser
  • BookingOrder_StatusLog
  • CalendarUtil
  • CalendarWidgetExtention
  • CatalogCatalogLinkedDecorator
  • CatalogImportTask
  • CatalogOldFieldsDecorator
  • CatalogProductLinkedDecorator
  • CheckoutStep_ShippingMethod
  • ChequePayment
  • ClearHistoryTask
  • ClientEmailOrderNotification_SiteConfig
  • ClientVKOrderNotification_SiteConfig
  • CommentsSiteConfig
  • ContactsPage
  • CookieExtention
  • CostTableShippingRate
  • CustomMenu
  • CustomMenuAdmin
  • CustomMenuDecorator
  • CustomMenuHolder
  • CustomMenuItem
  • CustomPayment
  • DataObjectLoggerExtension
  • DataObjectSubsites
  • DefaultCMSActionDecorator
  • DeleteOldAssociatedFoldersTask
  • DocPage
  • DocumentDirection
  • DocumentHaving
  • DocumentSearchForm
  • DocumentSiteConfig
  • DocumentsPage
  • DocumentType
  • DOMUtil
  • ExtendPageAnnouncement
  • ExtendPageNews
  • ExtendPagePoll
  • FileOversizeDecorator
  • FindCyrillicSiteConfig
  • FolderRenameTask
  • GDMergeAlpha
  • HomePage
  • ImageAutoResize
  • ImageResizeTask
  • ImportAdmin
  • ImportAutoStartTask
  • ImportCatalogMessage
  • ImportConfig
  • ImportLog
  • ImportSiteConfig
  • ImportTask
  • LoggerAdmin
  • LogItem
  • ManagerEmailOrderNotification_SiteConfig
  • MapObject
  • MapObjectGroup
  • MapPage
  • MediawebForm
  • MediawebImportParser
  • MemberLoggerExtension
  • MultiUploadConfig
  • NearestEventExtention
  • NewDocumentsAdmin
  • News_Controller
  • NewsEntry
  • NewsEntry_Controller
  • NewsHolder
  • NewsHolder_Controller
  • NewsLiveCalendarWidget
  • NewsSiteConfig
  • Order_StatusLog
  • Orders1CExchange
  • PageHideFieldsExtension
  • PageInformerRates
  • PageInformerWeather
  • Payment_Failure
  • Payment_Processing
  • Payment_Result
  • Payment_Success
  • PaymentMethod
  • PaymentSiteConfig
  • PayPalPayment
  • PayPalPayment_Handler
  • PhoneField
  • PhotoAlbumExtentions
  • PhpCaptcha
  • PhpCaptchaColour
  • PhpCaptchaField
  • phpMorphy
  • phpMorphy_AncodesResolver_AsIs
  • phpMorphy_AncodesResolver_Proxy
  • phpMorphy_AncodesResolver_ToDialingAncodes
  • phpMorphy_AncodesResolver_ToText
  • phpMorphy_AnnotDecoder_Base
  • phpMorphy_AnnotDecoder_Common
  • phpMorphy_AnnotDecoder_Factory
  • phpMorphy_AnnotDecoder_Predict
  • phpMorphy_FilesBundle
  • phpMorphy_Fsa
  • phpMorphy_Fsa_Decorator
  • 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
  • phpMorphy_Fsa_WordsCollector
  • phpMorphy_GramInfo
  • phpMorphy_GramInfo_AncodeCache
  • phpMorphy_GramInfo_Decorator
  • phpMorphy_Graminfo_File
  • phpMorphy_Graminfo_Mem
  • phpMorphy_GramInfo_Proxy
  • phpMorphy_GramInfo_Proxy_WithHeader
  • phpMorphy_GramInfo_RuntimeCaching
  • phpMorphy_Graminfo_Shm
  • phpMorphy_GrammemsProvider_Base
  • phpMorphy_GrammemsProvider_Decorator
  • phpMorphy_GrammemsProvider_Empty
  • phpMorphy_GrammemsProvider_Factory
  • phpMorphy_GrammemsProvider_ForFactory
  • phpMorphy_GrammemsProvider_ru_RU
  • phpMorphy_GramTab
  • phpMorphy_GramTab_Empty
  • phpMorphy_GramTab_Proxy
  • phpMorphy_Link
  • phpMorphy_Link_Annot
  • phpMorphy_Link_Base
  • phpMorphy_Morphier_Base
  • phpMorphy_Morphier_Bulk
  • phpMorphy_Morphier_Common
  • phpMorphy_Morphier_Empty
  • phpMorphy_Morphier_Finder_Base
  • phpMorphy_Morphier_Finder_Common
  • phpMorphy_Morphier_Finder_Predict_Databse
  • phpMorphy_Morphier_Finder_Predict_Suffix
  • phpMorphy_Morphier_Helper
  • phpMorphy_Morphier_Predict_Database
  • phpMorphy_Morphier_Predict_Suffix
  • phpMorphy_Morphier_PredictCollector
  • phpMorphy_Semaphore
  • phpMorphy_Semaphore_Empty
  • phpMorphy_Semaphore_Nix
  • phpMorphy_Semaphore_Win
  • phpMorphy_Shm_Cache
  • phpMorphy_Shm_Cache_FileDescriptor
  • phpMorphy_Shm_Header
  • phpMorphy_Source_Dba
  • phpMorphy_Source_Fsa
  • phpMorphy_State
  • phpMorphy_Storage
  • phpMorphy_Storage_Factory
  • phpMorphy_Storage_File
  • phpMorphy_Storage_Mem
  • phpMorphy_Storage_Proxy
  • phpMorphy_Storage_Shm
  • phpMorphy_UnicodeHelper
  • phpMorphy_UnicodeHelper_Base
  • phpMorphy_UnicodeHelper_MultiByteFixed
  • phpMorphy_UnicodeHelper_singlebyte
  • phpMorphy_UnicodeHelper_ucs_2be
  • phpMorphy_UnicodeHelper_ucs_2le
  • phpMorphy_UnicodeHelper_ucs_4be
  • phpMorphy_UnicodeHelper_ucs_4le
  • phpMorphy_UnicodeHelper_utf_16_Base
  • phpMorphy_UnicodeHelper_utf_16be
  • phpMorphy_UnicodeHelper_utf_16le
  • phpMorphy_UnicodeHelper_utf_32_Base
  • phpMorphy_UnicodeHelper_utf_32be
  • phpMorphy_UnicodeHelper_utf_32le
  • phpMorphy_UnicodeHelper_utf_8
  • phpMorphy_WordDescriptor
  • phpMorphy_WordDescriptor_Collection
  • phpMorphy_WordDescriptor_Collection_Serializer
  • phpMorphy_WordForm
  • ProductImportV1Decorator
  • ProductOldFieldsDecorator
  • ProductProductLinkedDecorator
  • PublHolder
  • Publication
  • PublicationSiteTree
  • RatingDataObject
  • RatingExtension
  • RealtySiteConfigDecorator
  • RecentComments
  • RecentFiles
  • RecentPages
  • RelatedPageLink
  • RepairImportTask
  • RoomRate_PriceField
  • RussianUpLower
  • SberbankPayment
  • SberbankPayment_Handler
  • SetMainSiteHomePageTypeTask
  • ShippingEstimator
  • ShippingPackage
  • ShowUserFromExtension
  • SiteConfigDecorator
  • SiteConfigSubsites
  • SiteTreeSubsites
  • SMSCOrderNotification_SiteConfig
  • SMSOrderNotification_SiteConfig
  • SortCMSActionDecorator
  • SS_Report_FakeQuery
  • SSMorphy
  • SSNController
  • SteppedCheckout_PageMessages
  • SubpageListField
  • SubscribeFormAllPagesExtension
  • SubsiteDropdownField
  • SubsiteReportWrapper
  • TableShippingRate
  • UnitellerPayment
  • UnitellerPayment_Handler
  • UnmoderatedComments
  • VideoManager
  • VideoSiteConfig
  • WatermarkImage
  • WatermarkSiteConfig
  • WebylonImportAdmin
  • WebylonImportCatalog
  • WeightTableShippingRate
  • XMLValidate
  • YaMoneyPayment
  • YaMoneyPayment_Handler
  • YMLExporter
  • YMLSiteConfig

Interfaces

  • ImportInterface
  • PaymentObjectInterface
  • phpMorphy_AncodesResolver_Interface
  • phpMorphy_AnnotDecoder_Interface
  • phpMorphy_Fsa_Interface
  • phpMorphy_GramInfo_Interace
  • phpMorphy_GrammemsProvider_Interface
  • phpMorphy_GramTab_Interface
  • phpMorphy_Morphier_Finder_Interface
  • phpMorphy_Morphier_Interface
  • phpMorphy_Shm_Cache_Interface
  • phpMorphy_Source_Interface

Exceptions

  • phpMorphy_Exception

Functions

  • column_sort
  • column_sort_callback_basic
  • encodeFileForEmail
  • encodeMultipart
  • getMimeType
  • htmlEmail
  • loadMimeTypes
  • phpmorphy_overload_mb_funcs
  • plaintextEmail
  • processHeaders
  • QuotedPrintable_encode
  • supressOutput
  • validateError
  • validEmailAddr
  • wrapImagesInline
  • wrapImagesInline_rewriter
  1 <?php
  2  /**
  3  * This file is part of phpMorphy library
  4  *
  5  * Copyright c 2007-2008 Kamaev Vladimir <heromantor@users.sourceforge.net>
  6  *
  7  * This library is free software; you can redistribute it and/or
  8  * modify it under the terms of the GNU Lesser General Public
  9  * License as published by the Free Software Foundation; either
 10  * version 2 of the License, or (at your option) any later version.
 11  *
 12  * This library is distributed in the hope that it will be useful,
 13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15  * Lesser General Public License for more details.
 16  *
 17  * You should have received a copy of the GNU Lesser General Public
 18  * License along with this library; if not, write to the
 19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 20  * Boston, MA 02111-1307, USA.
 21  */
 22 
 23 interface phpMorphy_GramTab_Interface {
 24     function getGrammems($ancodeId);
 25     function getPartOfSpeech($ancodeId);
 26     function resolveGrammemIds($ids);
 27     function resolvePartOfSpeechId($id);
 28     function includeConsts();
 29     function ancodeToString($ancodeId, $commonAncode = null);
 30     function stringToAncode($string);
 31     function toString($partOfSpeechId, $grammemIds);
 32 }
 33 
 34 class phpMorphy_GramTab_Empty implements phpMorphy_GramTab_Interface {
 35     function getGrammems($ancodeId) { return array(); }
 36     function getPartOfSpeech($ancodeId) { return 0; }
 37     function resolveGrammemIds($ids) { return is_array($ids) ? array() : ''; }
 38     function resolvePartOfSpeechId($id) { return ''; }
 39     function includeConsts() { }
 40     function ancodeToString($ancodeId, $commonAncode = null) { return ''; }
 41     function stringToAncode($string) { return null; }
 42     function toString($partOfSpeechId, $grammemIds) { return ''; }
 43 }
 44 
 45 class phpMorphy_GramTab_Proxy implements phpMorphy_GramTab_Interface {
 46     protected $storage;
 47     
 48     function __construct(phpMorphy_Storage $storage) {
 49         $this->storage = $storage;
 50     }
 51     
 52     function getGrammems($ancodeId) {
 53         return $this->__obj->getGrammems($ancodeId);
 54     }
 55     
 56     function getPartOfSpeech($ancodeId) {
 57         return $this->__obj->getPartOfSpeech($ancodeId);
 58     }
 59     
 60     function resolveGrammemIds($ids) {
 61         return $this->__obj->resolveGrammemIds($ids);
 62     }
 63     
 64     function resolvePartOfSpeechId($id) {
 65         return $this->__obj->resolvePartOfSpeechId($id);
 66     }
 67     
 68     function includeConsts() {
 69         return $this->__obj->includeConsts();
 70     }
 71 
 72     function ancodeToString($ancodeId, $commonAncode = null) {
 73         return $this->__obj->ancodeToString($ancodeId, $commonAncode);
 74     }
 75     
 76     function stringToAncode($string) {
 77         return $this->__obj->stringToAncode($string);
 78     }
 79 
 80     function toString($partOfSpeechId, $grammemIds) {
 81         return $this->__obj->toString($partOfSpeechId, $grammemIds);
 82     }
 83 
 84     function __get($name) {
 85         if($name === '__obj') {
 86             $this->__obj = phpMorphy_GramTab::create($this->storage);
 87             unset($this->storage);
 88             
 89             return $this->__obj;
 90         }
 91         
 92         throw new phpMorphy_Exception("Invalid prop name '$name'");
 93     }
 94 }
 95 
 96 class phpMorphy_GramTab implements phpMorphy_GramTab_Interface {
 97     protected
 98         $data,
 99         $ancodes,
100         $grammems,
101         // $__ancodes_map,
102         $poses;
103     
104     protected function __construct(phpMorphy_Storage $storage) {
105         $this->data = unserialize($storage->read(0, $storage->getFileSize()));
106         
107         if(false === $this->data) {
108             throw new phpMorphy_Exception("Broken gramtab data");
109         }
110         
111         $this->grammems = $this->data['grammems'];
112         $this->poses = $this->data['poses'];
113         $this->ancodes = $this->data['ancodes'];
114     }
115     
116     // TODO: remove this
117     static function create(phpMorphy_Storage $storage) {
118         return new phpMorphy_GramTab($storage);
119     }
120     
121     function getGrammems($ancodeId) {
122         if(!isset($this->ancodes[$ancodeId])) {
123             throw new phpMorphy_Exception("Invalid ancode id '$ancodeId'");
124         }
125         
126         return $this->ancodes[$ancodeId]['grammem_ids'];
127     }
128 
129     function getPartOfSpeech($ancodeId) {
130         if(!isset($this->ancodes[$ancodeId])) {
131             throw new phpMorphy_Exception("Invalid ancode id '$ancodeId'");
132         }
133         
134         return $this->ancodes[$ancodeId]['pos_id'];
135     }
136     
137     function resolveGrammemIds($ids) {
138         if(is_array($ids)) {
139             $result = array();
140             
141             foreach($ids as $id) {
142                 if(!isset($this->grammems[$id])) {
143                     throw new phpMorphy_Exception("Invalid grammem id '$id'");
144                 }
145                 
146                 $result[] = $this->grammems[$id]['name'];
147             }
148             
149             return $result;
150         } else {
151             if(!isset($this->grammems[$ids])) {
152                 throw new phpMorphy_Exception("Invalid grammem id '$ids'");
153             }
154             
155             return $this->grammems[$ids]['name'];
156         }
157     }
158     
159     function resolvePartOfSpeechId($id) {
160         if(!isset($this->poses[$id])) {
161             throw new phpMorphy_Exception("Invalid part of speech id '$id'");
162         }
163         
164         return $this->poses[$id]['name'];
165     }
166     
167     function includeConsts() {
168         require_once(PHPMORPHY_DIR . '/gramtab_consts.php');
169     }
170 
171     function ancodeToString($ancodeId, $commonAncode = null) {
172         if(isset($commonAncode)) {
173             $commonAncode = implode(',', $this->getGrammems($commonAncode)) . ',';
174         }
175 
176         return
177             $this->getPartOfSpeech($ancodeId) . ' ' .
178             $commonAncode .
179             implode(',', $this->getGrammems($ancodeId));
180     }
181 
182     protected function findAncode($partOfSpeech, $grammems) {
183     }
184 
185     function stringToAncode($string) {
186         if(!isset($string)) {
187             return null;
188         }
189 
190         if(!isset($this->__ancodes_map[$string])) {
191             throw new phpMorphy_Exception("Ancode with '$string' graminfo not found");
192         }
193 
194         return $this->__ancodes_map[$string];
195     }
196 
197     function toString($partOfSpeechId, $grammemIds) {
198         return $partOfSpeechId . ' ' . implode(',', $grammemIds);
199     }
200 
201     protected function buildAncodesMap() {
202         $result = array();
203 
204         foreach($this->ancodes as $ancode_id => $data) {
205             $key = $this->toString($data['pos_id'], $data['grammem_ids']);
206 
207             $result[$key] = $ancode_id;
208         }
209 
210         return $result;
211     }
212 
213     function __get($propName) {
214         switch($propName) {
215             case '__ancodes_map':
216                 $this->__ancodes_map = $this->buildAncodesMap();
217                 return $this->__ancodes_map;
218         }
219 
220         throw new phpMorphy_Exception("Unknown '$propName' property");
221     }
222 }
223 
[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. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0