11eedcde84
- renamed package to mwmbl in pyproject.toml - tinysearchengine and indexer modules have been moved into mwmbl package folder - analyse module has been left as is in the root of the repo - import statements in tinysearchengine now use mwmbl.tinysearchengine - import statements in indexer now use mwmbl.indexer or mwmbl.tinysearchengine or relative imports like .paths - import statements in analyse now use mwmbl.indexer or mwmbl.tinysearchengine - final CMD in Dockerfile now uses updated path mwmbl.tinysearchengine.app - fixed a couple of import statement errors in tinysearchengine/indexer.py
20 lines
511 B
Python
20 lines
511 B
Python
from mwmbl.tinysearchengine.indexer import TinyIndex, NUM_PAGES, PAGE_SIZE, Document
|
|
from mwmbl.indexer.paths import INDEX_PATH
|
|
|
|
|
|
def get_items():
|
|
tiny_index = TinyIndex(Document, INDEX_PATH, NUM_PAGES, PAGE_SIZE)
|
|
items = tiny_index.retrieve('soup')
|
|
if items:
|
|
for item in items:
|
|
print("Items", item)
|
|
|
|
|
|
def run():
|
|
tiny_index = TinyIndex(Document, INDEX_PATH, NUM_PAGES, PAGE_SIZE)
|
|
for i in range(100):
|
|
tiny_index.get_page(i)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
run()
|