Create a reverse language dictionary

I was wondering what it takes to create a reverse language dictionary.

The user enters something like: "red edible fruit", and the application returns: "tomatoes, strawberries ..."

I suggest that these results should be based on some forms of keywords, such as synonyms, or some form of string search.

This is an online implementation of this concept.

What happens there and what happens?

EDIT 1: The question is more about β€œhow,” not about β€œwhat tool”; However, feel free to provide tools that you think should do the job.

+3
source share
9 answers

Any approach will basically include a normalized database . Here is a basic example of what your database structure looks like:

// terms
+-------------------+
| id | name         |
| 1  | tomatoes     |
| 2  | strawberries |
| 3  | peaches      |
| 4  | plums        |
+-------------------+

// descriptions
+-------------------+
| id | name         |
| 1  | red          |
| 2  | edible       |
| 3  | fruit        |
| 4  | purple       |
| 5  | orange       |
+-------------------+

// connections
+-------------------------+
| terms_id | descript_id  |
| 1        | 1            |
| 1        | 2            |
| 1        | 3            |
| 2        | 1            |
| 2        | 2            |
| 2        | 3            |
| 3        | 1            |
| 3        | 2            |
| 3        | 5            |
| 4        | 1            |
| 4        | 2            |
| 4        | 4            |
+-------------------------+

This will be a fairly simple setup, but it should give you an idea of ​​how many-to-many relationships using the lookup table work in databases.

Your application will have to break lines and be able to handle input normalization, for example, get rid of suffixes with user input. Then the script will query the table connectionsand return the results.

+3
source

OpenCyc is a computer database of real concepts and meanings of the real world. On its website:

OpenCyc - Cyc, . OpenCyc .

, , - . , .

+5

"" , : iPhone , , - .

, .

+4

-, - (, "" ) .

, , , "", "" "", .

( ): //, , , .

, :

:

0001  aardvark
....
0050  strawberry
....
0072  tomato
....
0120  zoo

:

0001  big
0002  small
0003  fruit
0004  vegetable
0005  mineral
0006  metal
....
0250  black
0251  blue
0252  red
....
0570  edible

, :

0050 -> 0003
0050 -> 0252
0050 -> 0570
0072 -> 0003
0072 -> 0252
0072 -> 0570

"": 0050 () "" 0003 (), "" 0252 () "" 0570 ().

+1

,

  • " , . , , , , ",
  • " , ",
  • " , / - Sound of Urchin".

? , . , ontology, , Princeton WordNet, - , .

+1

. . . , .

, , , 3 4 .

0

( , "", ""...), , ( , , )?

0

Prolog.

-1

Source: https://habr.com/ru/post/1723112/


All Articles