PDA

View Full Version : Nice to have: Dictionary


Rolandks
09-17-2003, 02:18 AM
A very cool -but i think not easy- feature is a Dictionary if a search result is empty or < 2 or 3 hits.


See: Google - Did you mean: (http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=freee+dictonaary&btnG=Google+Search)

Are there free Dictionaries for all languages to use for this ?

Is it possible ?

-Roland-

Iltud
09-17-2003, 12:49 PM
Perhaps that phpDig could propose some approching words from its "keywords" table ?
(And a little bit of code, using Aspell functions)


In using the table "keywords", the proposed words are obligatorly known from phpDig. So, no second empty result in proposing known words... and no need of any dictonnary.

The dictionary IS the site.


Good idea ? or not ?



Nicolas.

Rolandks
09-17-2003, 04:13 PM
Originally posted by Iltud
In using the table "keywords", the proposed words are obligatorly known from phpDig. So, no second empty result in proposing known words... and no need of any dictonnary.

The dictionary IS the site.

Good idea ? or not ?
Nicolas.

Yes it is very good, i have same idea this evening :D , its better so you have no empty second empty result ...

Problem is: you need a search for ALL languages, and also special charakter in some language: á è and ä, ö, ü (french, german)

:: Examples (ok some nonsense example :rolleyes: ) ::

Search: management operator - was not found, so phpdig: did you mean: manager operating

Search: ranked - was not found, so phpdig: did you mean: ranking

-- any words part begin, end and middle must found.

Any other difficulty words ?

-Roland-

Rolandks
09-22-2003, 01:30 PM
Perhaps i have easy solution for this: :cool:

:: SOUNDEX :: LOOK Here (http://de3.php.net/manual/en/function.soundex.php)

SOUNDEX - Calculates the soundex key of string.

You must add a new table-field an insert all SOUNDEX of the keywords. Perhaps as new Link in Admin-Menu (generate alternate words)

If Search-HIT < 1 or 2 -as $variable in config.php- you look at the sondex-table:

For my example above:

SOUNDEX(management) = M525
SOUNDEX(manager) = M526

Did you mean: is here near next >= M525
AND
SOUNDEX(operator) = O163
SOUNDEX(operating) = O163

SOUNDEX(ranked) = R523
SOUNDEX(ranking) = R525

Did you mean: is here near next > R523

The soundex 'different letter in front' problem can be solved by using levenshtein() on the soundex codes. See first User Contributed Notes at my Llink above.

OR direct in SQL LIKE:

$sql = "SELECT * FROM keywords WHERE substring(soundex(keyword), 1, 4) = substring(soundex('".$search_string."'), 1, 4)";

Hmm, does this work :rolleyes: ?

-Roland-

Rolandks
09-26-2003, 09:00 AM
OKAY - NOW:

I have create as Testpage for this idea. :) :)

Test-Search for (little) Intelligent Php-Dig Fuzzy (http://www.kunstbar.tv/suche/suchp.php)

Try this search: "autentication" "deskription" "hiperlinks" and other ;)

I find this a verry :cool: :cool: feature for phpDig and i hope get some feedback and Suggestions !

My plan is:
- ideas to create better results
- create a Tag: phpdig: phonetic :D
- add phpdig: phonetic to index.php
- add this to the templates as: do you mean: ... (in all languages) and display to 2 TOP-hits
- add this seach to statistic --- found by phonetic ...

Problems are:
- different letter in front - problem
- special language character: ü. ö, ä, ß - German "Straße" is in Database but "Strasse" isn't found anything (engl. street.
- a little slow (perhaps create a Table-Field for SOUNDEX and add at indexing or a Link in Admin-Menu.

Iltud
09-26-2003, 10:09 AM
Yeah !!

Excellent work.

I did'nt even have enough time to work at my own on this feature (with Aspell or so).

I have to look at your links.

Very good !