Tim Sweetman > Text-Annotate > Text::Annotate::DataSource



Annotate this POD

Module Version: 0.012   Source  


Text::Annotate::DataSource - parent class for annotation data sources


An annotation datasource provides two things: a) a way to look up potential key phrases. Key phrases that match our data yield URIs or similar identifiers. b) a way to "explain" those URIs, producing a brief HTML description of the phrase in question.



Typical call:

$datasource->index_lookup ("get", "your", "widgets", ... "getyourwidgetsfrom", "wigentiacorp")

index_lookup is called with a list of (already canonicalised) key phrases. Where those phrases match one we know about, we return a two-element list.

Typical output:

(["wigentiacorp", "http://www.wigentia.com/"], ["herring", "http://www.example.com/fishguide/herring/"])

It is passed a list so we don't get overwhelmed by function-switching overhead, whilst painstakingly trundling through piles of useless words in search of something interesting.

You may well want to override this.

syntax highlighting: