PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Requests

Reply
 
Thread Tools
Old 09-17-2003, 01:18 AM   #1
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Nice to have: Dictionary

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:


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

Is it possible ?

-Roland-
Rolandks is offline   Reply With Quote
Old 09-17-2003, 11:49 AM   #2
Iltud
Green Mole
 
Join Date: Sep 2003
Location: Brest - France
Posts: 22
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.
Iltud is offline   Reply With Quote
Old 09-17-2003, 03:13 PM   #3
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Quote:
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 , 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 ) ::

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 is offline   Reply With Quote
Old 09-22-2003, 12:30 PM   #4
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Perhaps i have easy solution for this:

:: SOUNDEX :: LOOK Here

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 ?

-Roland-

Last edited by Rolandks; 09-22-2003 at 01:26 PM.
Rolandks is offline   Reply With Quote
Old 09-26-2003, 08:00 AM   #5
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
OKAY - NOW:

I have create as Testpage for this idea.

Test-Search for (little) Intelligent Php-Dig Fuzzy

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

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

My plan is:
- ideas to create better results
- create a Tag: phpdig: phonetic
- 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.

Last edited by Rolandks; 09-26-2003 at 11:45 AM.
Rolandks is offline   Reply With Quote
Old 09-26-2003, 09:09 AM   #6
Iltud
Green Mole
 
Join Date: Sep 2003
Location: Brest - France
Posts: 22
Thumbs up

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 !
Iltud is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nice Job On The Forum Changes! vinyl-junkie The Mole Hole 1 02-29-2004 08:23 AM
Dictionary or something more complex? damian Mod Requests 3 11-07-2003 07:42 AM


All times are GMT -8. The time now is 12:47 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.