Source for file stemmer.php
Documentation is available at stemmer.php
* @package Joomla.Administrator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Stemmer base class for the Finder indexer package.
* @package Joomla.Administrator
* An internal cache of stemmed tokens.
* Method to get a stemmer, creating it if necessary.
* @param string $adapter The type of stemmer to load.
* @return FinderIndexerStemmer A FinderIndexerStemmer instance.
* @throws Exception on invalid stemmer.
// Only create one stemmer for each adapter.
if (isset
($instances[$adapter]))
return $instances[$adapter];
// Create an array of instances if necessary.
// Setup the adapter for the stemmer.
$path = __DIR__ .
'/stemmer/' .
$adapter .
'.php';
$class =
'FinderIndexerStemmer' .
ucfirst($adapter);
// Check if a stemmer exists for the adapter.
// Instantiate the stemmer.
$instances[$adapter] =
new $class;
// Throw invalid adapter exception.
throw
new Exception(JText::sprintf('COM_FINDER_INDEXER_INVALID_STEMMER', $adapter));
return $instances[$adapter];
* Method to stem a token and return the root.
* @param string $token The token to stem.
* @param string $lang The language of the token.
* @return string The root token.
abstract public function stem($token, $lang);
Documentation generated on Tue, 19 Nov 2013 15:14:21 +0100 by phpDocumentor 1.4.3