From 6273011e0731f81584a071f10d9933f8777aa442 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 11 Jan 2013 09:50:31 +0100 Subject: We'll try a simple index searching algorithm. --- source/search.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 source/search.py (limited to 'source/search.py') diff --git a/source/search.py b/source/search.py new file mode 100644 index 00000000..582108ae --- /dev/null +++ b/source/search.py @@ -0,0 +1,20 @@ +#! /usr/bin/env/python +# -*- coding: utf-8 -*- + +import utils + +class Search(object): + """ + """ + def __init__(self): + self.terms = {} + + def index(self): + pass + + def search(self, word): + result = [] + for term, texts in self.terms.items(): + if word in term: + result.extend(text) + return result \ No newline at end of file -- cgit