PHP code example of go / ewp

1. Go to this page and download the library: Download go/ewp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

go / ewp example snippets


use go\ewp\Locale;

$parser = Locale::getSysLocale('ru')->getParser();

echo $parser->parse('malfermigxis'); // (mal)ferm<igx>[is]

$dict = $locale->getDict();
$root = $dict->getRoot($result->root); // ferm --> fermi
echo $dict->translate($root); // fermi --> закрывать

echo $locale->getPrefixes()->translate('mal'); // противоположность

echo $locale->getPrefixes()->translate('igx'); // становиться

$phonetics = $locale->getPhonetics();
echo $phonetics('malfermigxis'); // малфэрмиджис

use go\ewp\Freq;

$freq = new Freq('file1.txt');
$freq->appendFile('file2.txt');
$freq->appendFile('file3.txt');
$freq->appendContent('Tio estas iom da enhavo');

$freq->getWords();

$res = $freq->passParser($parser);
plain
[la] => 7218
[mi] => 3342
[kaj] => 3156
[de] => 2010
[en] => 1289
[al] => 1215
[li] => 1204
[ne] => 1168
[estis] => 1136
[vi] => 847
plain
[la] => la
[mi] => mi
[kaj] => kaj
[de] => de
[estis] => est[is]
[ne] => ne
[li] => li
[al] => al
[en] => en
[vi] => vi
[por] => por
[estas] => est[as]
[ni] => ni
[ke] => ke
[sed] => sed
...