Module: urlblock/searchanalyzer

searchanalyzer analyzes search queries entered by the user in any search engine. It works with the URL that the search engines generate when serving search queries.

Example

searchanalyzer's use only requires a call to urlcheck with the URL of the search query.

var searchanalyzer = require('searchanalyzer.js');
searchanalyzer.urlcheck('https://www.youtube.com/results?search_query=content+holmes');

Members


<inner> banned

Loads the bannedmanager. See module:urlblock/bannedmanager

<inner> data

Loads searchanalyzer base data. See module:data/searchanalyzer

<inner> nlp

Loads the NLP module. See module:nlp/nlp

Methods


<inner> getUrlVars(url)

Takes the URL and extracts all the parameters in the get request.
Parameters:
Name Type Description
url The URL whose parameters need to be extracted.
Returns:
All parameters in the URL.
Type
Dictionary

<inner> paramscheck(params)

Checks the search parameters for profane content. Also triggers interest determination!
Parameters:
Name Type Description
params String The extracted search query from getUrlVars.
Returns:
Ration of profane words to the total number of words in the search query.
Type
Number

<inner> urlcheck(url)

Checks the URL to process it for information regarding search related data.
Parameters:
Name Type Description
url String This is the full URL of the search engine after search has been performed.
Returns:
Ratio of profane words to the total number of words in the search query.
Type
Number