douzao1119 2017-02-11 13:15
浏览 7
已采纳

如果单词错误或拼写错误或希腊单词获得英语结果,我怎样才能得到结果

How can i get result if word wrong or spelling wrong or Greek word enter get English result example:

in my web site i want to search "jeans" or "jenz" get same result its a simple examples my main concern if user enter same meaning word or wrong greek word but my site develop in English format how can this word search

can any one give me idea how i get solution for this problem my site in Laravel 5.2

  • 写回答

1条回答 默认 最新

  • dongru2019 2017-02-11 13:30
    关注

    For the "spelling wrong" part (Did you mean)

    You can publish the configuration file to your app directory and override the settings by running php artisan vendor:publish to copy the configuration to your config folder as searchy.php

    You can set the default driver to use for searches in the configuration file. Your options (at this stage) are: fuzzy, simple and levenshtein.

    You can also override these methods using the following syntax when running a search:

    By defining levenshtein distance you can finetune how far off a word can be.

    • If you need better performance you should consider something like solr or elasticsearch for this task.

    https://wiki.apache.org/solr/SpellCheckComponent https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-fuzzy-query.html

    For the translation part

    You just should have a dictionary ready in your database or localization files and run the input trough that as well. Expect high computing times for both spelling correction and translation in your code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办