Keyword Relevancy Algorithms
A small and simple algorithm in order to find relevant keywords in a text works as follows:
- initialising array of stop words and keywords,
- text preprocessing, such as lowercasing and removing peculiars,
- determining general text statistics, such as number of characters,
- removing stop words,
- exploding text to keyword array,
- iterating keyword array in order to count earch word,
- sorting and delivering result.
Download this JavaScript, embedded in HTML as ZIP file: algorithm_js.zip
Download this PHP code as ZIP file: algorithm_php.zip