diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-01-11 09:50:31 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-01-11 09:50:31 +0100 |
commit | 6273011e0731f81584a071f10d9933f8777aa442 (patch) | |
tree | 7030df7807279d1bad81a2ea4288ceddbcd6cef8 | |
parent | Updated documentation: 'Create a new user' section. (diff) | |
download | newspipe-6273011e0731f81584a071f10d9933f8777aa442.tar.gz newspipe-6273011e0731f81584a071f10d9933f8777aa442.tar.bz2 newspipe-6273011e0731f81584a071f10d9933f8777aa442.zip |
We'll try a simple index searching algorithm.
-rw-r--r-- | source/search.py | 20 |
1 files changed, 20 insertions, 0 deletions
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 |