Tagging item according to keywords
hi
is there any algorithm for tagging an item with the keywords and searching them according to these keywords.
for example, in a library, a Java programming book can be tagged with the keyword "java, programming, object oriented".
so, when a user search with any of these keyword, that book will be returned in the result.
regards
terence
[377 byte] By [
mtzo81a] at [2007-10-3 8:16:56]

generally this is called an index. Just like the index of a book where you look up a word and find a list of which pages that word lives on.
In a database you could keep a table where each row is a pair, a tag and a data item. If you querry this table on a single tag your drop is all the data items that matched the tag.
Presumably in memory you could do the same thing. Your index would be something like a Map where the keys are strings and the data element associated with a single key is a list of objects that match that tag.
I wouldn't exactly call this an algorithm it is more a data structure and how you do it depends more on where you do it. You were not clear on whether you are trying to tag items in a database or what.