<commit_before><?php
# vim:sw=4:ts=4:et:nowrap

/*
SEARCHENGINE class 2004-05-26
<EMAIL>

Example usage:

        include_once INCLUDESPATH."easyparliament/searchengine.php";

        $searchengine = new SEARCHENGINE($searchstring);
        $description = $searchengine->query_description();
        $short_description = $searchengine->query_description_short();

        $count = $searchengine->run_count();

        // $first_result begins at 0
        $searchengine->run_search($first_result, $results_per_page);
        $gids = $searchengine->get_gids();
        $relevances = $searchengine->get_relevances();

        $bestpos = $searchengine->position_of_first_word($body);
        $extract = $searchengine->highlight($extract);

*/

include_once INCLUDESPATH . 'dbtypes.php';
if (defined('XAPIANDB') && XAPIANDB)
	include_once '/usr/local/share/php5/xapian.php';

global $xapiandb;

class SEARCHENGINE {

	function SEARCHENGINE ($query) {
        if (!defined('XAPIANDB') || !XAPIANDB)
            return null;

		$this->query = $query;
        $this->stemmer = new XapianStem('english');
        $this->enquire = null; <commit_msg>Hack for two alternative locations for php xapian library<commit_after><?php
# vim:sw=4:ts=4:et:nowrap

/*
SEARCHENGINE class 2004-05-26
<EMAIL>

Example usage:

        include_once INCLUDESPATH."easyparliament/searchengine.php";

        $searchengine = new SEARCHENGINE($searchstring);
        $description = $searchengine->query_description();
        $short_description = $searchengine->query_description_short();

        $count = $searchengine->run_count();

        // $first_result begins at 0
        $searchengine->run_search($first_result, $results_per_page);
        $gids = $searchengine->get_gids();
        $relevances = $searchengine->get_relevances();

        $bestpos = $searchengine->position_of_first_word($body);
        $extract = $searchengine->highlight($extract);

*/

include_once INCLUDESPATH . 'dbtypes.php';
if (defined('XAPIANDB') && XAPIANDB) {
	if (file_exists('/usr/local/share/php5/xapian.php'))
		include_once '/usr/local/share/php5/xapian.php';
	if (file_exists('/usr/local/share/xapian-bindings/php5/xapian.php'))
		include_once '/usr/local/share/xapian-bindings/php5/xapian.php';
}

global $xapiandb;

class SEARCHENGINE {

	function SEARCHENGINE ($query) {
        if (!defined('XAPIANDB') || !XAPIANDB)
            return null;

		$this->query = $query;
        $this->stemmer = new XapianStem('english');
        $this->enquire = null; 
{'fraction_non_alphanumeric': 0.14495631453534552, 'fraction_numerical': 0.010722795869737888, 'mean_word_length': 3.6476014760147604, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5315867', 'n_tokens_mistral': 944, 'n_tokens_neox': 874, 'n_words': 134}