Learning with Texts - Fork 2.9.0-fork
Learn foreign languages with texts
|
PHP Utility Functions to calculate similar terms of a term. More...
Namespaces | |
namespace | Lwt |
Functions | |
letterPairs ($str) | |
wordLetterPairs ($str) | |
getSimilarityRanking ($str1, $str2) | |
get_similar_terms ( $lang_id, $compared_term, $max_count, $min_ranking) | |
format_term ($termid, $compare) | |
print_similar_terms ($lang_id, $compared_term) | |
print_similar_terms_tabrow () | |
PHP Utility Functions to calculate similar terms of a term.
PHP version 8.1
format_term | ( | $termid, | |
$compare | |||
) |
Prepare a field with a similar term to copy.
int | $termid | Initial term ID |
string | $compare | Similar term to copy. |
@global string $tbpref
get_similar_terms | ( | $lang_id, | |
$compared_term, | |||
$max_count, | |||
$min_ranking | |||
) |
For a language $lang_id and a term $compared_term (UTF-8). If string is already in database, it will be excluded in results.
int | $lang_id | Language ID |
string | $compared_term | Term to compare with |
int | $max_count | Maximum number of terms to display |
float | $min_ranking | For terms to match |
@psalm-return array<positive-int, int>
getSimilarityRanking | ( | $str1, | |
$str2 | |||
) |
Similarity ranking of two UTF-8 strings $str1 and $str2
Source http://www.catalysoft.com/articles/StrikeAMatch.html Source http://stackoverflow.com/questions/653157
letterPairs | ( | $str | ) |
@psalm-return array<0|positive-int, string>
print_similar_terms | ( | $lang_id, | |
$compared_term | |||
) |
print_similar_terms_tabrow | ( | ) |
Print a row for similar terms if the feature is enabled.
wordLetterPairs | ( | $str | ) |
@psalm-return list<string>