PHP code example of crosseno / lexicon
1. Go to this page and download the library: Download crosseno/lexicon 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/ */
crosseno / lexicon example snippets
use Crosseno\Core\Grid\CellSymbol;
use Crosseno\Lexicon\Candidate\CandidateConstraints;
use Crosseno\Lexicon\Candidate\CandidateOrdering;
use Crosseno\Lexicon\Candidate\CandidateQuery;
use Crosseno\Lexicon\Pattern\CandidatePattern;
use Crosseno\Lexicon\Pattern\PatternCell;
$pattern = new CandidatePattern([
PatternCell::fixed(new CellSymbol('Ł')),
PatternCell::unknown(),
PatternCell::fixed(new CellSymbol('DŹ')),
]);
$query = new CandidateQuery(
$pattern,
CandidateConstraints::permissive(),
maximumResults: 100,
ordering: CandidateOrdering::RankDescending,
);
$candidates = $lexicon->candidates($query);