public static function setLanguageDir($dir)
 {
     self::$language_dir = $dir;
 }
Beispiel #2
0
and Aunt Em had a big bed in one corner, and Dorothy a little bed in
another corner.  There was no garret at all, and no cellar--except a
small hole dug in the ground, called a cyclone cellar, where the family
could go in case one of those great whirlwinds arose, mighty enough to
crush any building in its path.  It was reached by a trap door in the
middle of the floor, from which a ladder led down into the small, dark
hole.
EOF
);
$source = isset($_REQUEST['source']) ? $_REQUEST['source'] : $text;
$language = isset($_REQUEST['language']) ? $_REQUEST['language'] : 'en-us';
$languages = array('af' => 'Afrikaans', 'hyph-zh-latn-pinyin' => 'Chinese - Pinyin', 'da' => 'Danish', 'nl' => 'Dutch', 'en-us' => 'English - American', 'en-gb' => 'English - British', 'de' => 'German', 'fi' => 'Finnish', 'fr' => 'French', 'id' => 'Indonesian', 'it' => 'Italian', 'la' => 'Latin', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'ru' => 'Russian', 'sl' => 'Slovenian', 'es' => 'Spanish', 'sv' => 'Swedish', 'tr' => 'Turkish');
asort($languages);
// phpSyllable code
require_once dirname(__FILE__) . '/classes/autoloader.php';
$syllable = new Syllable($language);
$syllable->getCache()->setPath(dirname(__FILE__) . '/cache');
$syllable->getSource()->setPath(dirname(__FILE__) . '/languages');
?>
<html>
	<head>
		<title>phpSyllable</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<style>
			* {
				font-family: 'Segoe UI', Verdana, Arial, Helvetica, sans-serif;
				font-size: 14px;
			}

			html {
				padding: 1em 2em;
Beispiel #3
0
 /**
  * @covers Syllable::countWordsText
  */
 public function testCountWordsText()
 {
     $this->object->setLanguage('en-us');
     $this->assertSame(0, $this->object->countWordsText('.'));
     $this->assertSame(6, $this->object->countWordsText('1 is wonder welcome furthermore sophisticated extravagantically.'));
 }