Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
p-baleine committed Jan 7, 2021
0 parents commit 19f5e9d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.8.6
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# naivesearch
37 changes: 37 additions & 0 deletions examples/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# index = InvertedIndex(
# '/path/to/file', # FileReader('/path/to/file')
# [
# compose(
# UnicodeNormalizer(),
# CharacterChunker(), # hello => h e l l o
# NgramConverter([2, 3]) # h e l l o => he el ll lo
# )
# compose( # => heelo => h e l l o
# UnicodeNormalizer(),
# RubyFormater()
# CharacterChunker(), # hello => h e l l o
# NgramConverter([2, 3]) # h e l l o => he el ll lo
# )
# ]
# )

def split_sentence(s):
return list(s)


class InvertedIndex:
def __init__(self, path_to_file, chunkers):
pass

def __getitem__(self, q):
return ['hoge', 'hoo']


index = InvertedIndex(
'/path/to/file', # FileReader('/path/to/file')
[
split_sentence
]
)

print(index['ho']) #=> [hoge, hooo]
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tool.poetry]
name = "naivesearch"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]

[tool.poetry.dependencies]
python = "3.8.6"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 19f5e9d

Please sign in to comment.