I have an app that checks the spelling entered by the user. What i am trying to do is when user corrects there spelling it shows them the complete meaning of the word. Is there any free api i can use to do this? With no limitations?
Also i tried finding a dictionary with meaning that i can upload to my server which will have over 200k words and all the meanings in it. But i am unable to find any. Have anyone here used a dictionary like this that you can refer me to?
I looked at this:
English dictionary SQL dump?
but these also dont have meanings with them
How about exporting the data from Wiktionary? You could write a script to automatically export the entries you need (maybe based on some wordlist). See http://en.wiktionary.org/wiki/Special:Export
Related
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
For the "spelling wrong" part (Did you mean)
You could do some LIKE queries in the db e.g. LIKE %j%e%a%n%s% but if you want to do it well, you should use a search library like this:
https://github.com/TomLingham/Laravel-Searchy
http://tnt.studio/blog/did-you-mean-functionality-with-laravel-scout
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.
I'm working on redirecting people if they type a "not really wrong url".
For example I have a good URL http://www.website.com/category/foo-bar-if-bar-foo/.
This one works so if a user enter to my website with it, I can retrieve the article corresponding.
But if someone enter to my website with a not really wrong url like http://www.website.com/category/foo-bar-foo/ because an another website has referenced a wrong url, I should redirect him to the right one instead of having a 404 status code...
So how should I do this? and Most important, should I do this ?
I actually use Eloquent with Laravel 4.2.
Thank you in advance.
EDIT
I was wrong about stackoverflow, thanks for your comment. It uses the unique ID of a post.
EDIT 2
I Looked at SOUNDEX function in SQL, it's really good if there is a small difference like a character or two missing. But if my url is as broken as my example, it's not working anymore obviously. But thanks it's gonna be usefull.
Just thinking off the top of my head, you could create a SQL table (with Full-Text indexing enabled) containing all your paths (it might already exist).
In the event that a 404 is triggered, hijack that and do a MATCH (Full Text Search) and return the path with the highest scoring MATCH (you can also consider using a score threshold to prevent nonsensical matches).
Today I've found a malware on one site, I have deleted it, of course, and everything is ok, but in order to understand where it comes from, I would like to understand its logic, but it is encoded, in a quite easy way. At the beginning of the file I see:
$i96="QU~T<`_YM82iAN>/v#s\"'q#tZFjJX6a\tcI)yS^boD.\$du|3\rWw=rC!;[4*P5LVkB?%19m:p7 -zK,gOl{Efx]0R}&h+\n\\(enGH";
This is used then in all the rest of the file, as a dictionary of characters, from now on, there are all assignments like this:
$GLOBALS['rpdxi45'] = $i96[94].$i96[51].$i96[51].$i96[39].$i96[51].$i96[6].$i96[51].$i96[94].$i96[70].$i96[39].$i96[51].$i96[23].$i96[11].$i96[95].$i96[77];
Does anyone has a clue on how I can decode this (without infecting a server of mine, of course), or at least has the name of this type of encryption? Just to know if I can find something on the web.
If someone is interested, I can post the rest of the file, I found it odd.
Update: the file is actually a malicious shell hack. If you find it on your server, delete it and contact your sysadmin.
It is obfuscating the phrase "error_reporting"
<?php
$i96="QU~T<`_YM82iAN>/v#s\"'q#tZFjJX6a\tcI)yS^boD.\$du|3\rWw=rC!;[4*P5LVkB?%19m:p7 -zK,gOl{Efx]0R}&h+\n\\(enGH";
echo $i96[94].$i96[51].$i96[51].$i96[39].$i96[51].$i96[6].$i96[51].$i96[94].$i96[70].$i96[39].$i96[51].$i96[23].$i96[11].$i96[95].$i96[77];
$GLOBALS['rpdxi45'] is storing a string constructed from the characters of the string held in $i96.
Echoing $GLOBALS['rpdxi45'] will show you the string that has been constructed.
See here: http://ideone.com/Jy1uty
OK i will write as clear as possible
it's an e-commerce web site and there is a lot of goods
so i have a searching form that send's the input to a php script via jquery's post
method(ajax) now what i want to do is to check if the input (from the form) is equal
or close to one of the word's in my DB but i cant write a regexp for every single word so is
there a solution ???
for example if the client want to see our offers for pentuim 4 and he wrote peniuom it should tell that "do you mean pentuim"
i hope that i can get an answer now
You could just send the user input to a LIKE query and get the database to do the search work - they are pretty good at that :-)
If there are no results for an exact match then you could pass the search terms through a spell-checker first or use a fuzzy search.
How do I do a fuzzy match of company names in MYSQL with PHP for auto-complete? might also help.
I need to change UK spelling to US spelling for the content stored in the database(mysql). Is there any way to do this on the db itself? I found various software's(like a word add-ins) but to use these I need to have the data in a doc format, do the changes and export it back to mysql. Please let me know if there is a method using php/mysql to change the spellings. Checked out things like pspell and other classes(found through google search) but they do not these conversion of uk to us.
regards
I'm fairly sure there's no possibility to do this in mySQL - it is a task that definitely should not be performed by the DBMS.
If no PHP based solution comes up, there are lists like the one from the spelling society that may allow for automatic conversion to some degree - they even come with variations like
cudgel +led, +ling > cudgel +ed, +ing
it is far from complete, though.
May I ask what you need this for?