本文整理汇总了PHP中Converter::ToLatin方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::ToLatin方法的具体用法?PHP Converter::ToLatin怎么用?PHP Converter::ToLatin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter::ToLatin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: comparer
function comparer($a, $b)
{
if ($a['accuracy'] > $b['accuracy']) {
return -1;
}
if ($a['accuracy'] < $b['accuracy']) {
return 1;
}
if ($a['accuracy'] == $b['accuracy']) {
$aLev = levenshtein(Converter::ToLatin($a['value']), $GLOBALS['RhymeWord']);
$bLev = levenshtein(Converter::ToLatin($b['value']), $GLOBALS['RhymeWord']);
if ($aLev > $bLev) {
return 1;
}
if ($aLev < $bLev) {
return -1;
}
return 0;
}
}
示例2: extractResult
function extractResult($filterType, $param)
{
$arr = array();
$servername = "localhost";
$username = "testUser";
$password = "testPassword";
$dbname = "geoWords";
// Create connection
$mysqli = new mysqli($servername, $username, $password, $dbname);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit;
}
if (!$mysqli->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $mysqli->error);
exit;
}
$query = "select word_geo from words where word_eng " . $filterType . " ? ";
if ($stmt = $mysqli->prepare($query)) {
$param = Converter::ToLatin($param);
$stmt->bind_param("s", $param);
/* execute statement */
$stmt->execute();
// bind result variables
$stmt->bind_result($word_value);
$counter = 0;
//fetch values
while ($stmt->fetch()) {
if ($counter++ > 999) {
break;
}
array_push($arr, array('id' => $counter, 'value' => $word_value));
}
/* close statement */
$stmt->close();
}
$mysqli->close();
return $arr;
}
示例3: extractResult
function extractResult($filterType, $param)
{
$arr = array();
$query = "select word_geo from words where word_eng " . $filterType . " ? ";
$mysqli = getMysqli();
$stmt = getStatementByQueryFromMysqli($query, $mysqli);
$param = Converter::ToLatin($param);
$stmt->bind_param("s", $param);
/* execute statement */
$stmt->execute();
// bind result variables
$stmt->bind_result($word_value);
$counter = 0;
//fetch values
while ($stmt->fetch()) {
if ($counter++ > 999) {
break;
}
array_push($arr, array('id' => $counter, 'value' => $word_value));
}
closeConnections($stmt, $mysqli);
return $arr;
}
示例4: vowelsCount
<?php
include 'common.php';
$param = $_GET['template'];
$string = Converter::ToLatin($param);
echo $param . '<br>';
echo "<br>";
$vowelsCount = vowelsCount($string);
$rhymeLevel1Regex = '$';
$rhymeLevel2Regex = '$';
$rhymeLevel3Regex = '$';
$rhymeLevel4Regex = '$';
$rhymeLevel5Regex = '$';
$rhymeLevel6Regex = '$';
$splitedArray = splitBackPartByVowel($string);
print_r($splitedArray);
if ($vowelsCount > 0) {
$ConsonantReplacer1 = "";
$ConsonantReplacer2 = "";
$ConsonantReplacer3 = "";
$ConsonantReplacer4 = "";
$ConsonantReplacer5 = "";
$ConsonantReplacer6 = "[^aeiou]*";
if ($splitedArray[5] != '') {
$ConsonantReplacer1 = $splitedArray[5];
$ConsonantReplacer2 = "";
$ConsonantReplacer3 = "";
$ConsonantReplacer4 = "";
$ConsonantReplacer5 = "";
}
$rhymeLevel1Regex = $splitedArray[4] . $ConsonantReplacer1 . $rhymeLevel1Regex;