Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ranked completer #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
563 changes: 409 additions & 154 deletions src/_base_types.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_completer.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_dawg.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_dawg_builder.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_dictionary.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_dictionary_builder.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_dictionary_unit.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_guide.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_guide_builder.cpp

Large diffs are not rendered by default.

563 changes: 409 additions & 154 deletions src/_guide_unit.cpp

Large diffs are not rendered by default.

1,591 changes: 1,591 additions & 0 deletions src/_ranked_completer.cpp

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions src/_ranked_completer.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from _base_types cimport BaseType, SizeType, ValueType
from _dawg cimport Dawg
from _dictionary cimport Dictionary
from _ranked_guide cimport RankedGuide

cdef extern from "../lib/dawgdic/ranked-completer.h" namespace "dawgdic" nogil:
cdef cppclass RankedCompleter:
RankedCompleter()
RankedCompleter(Dictionary &dic, RankedGuide &guide)

void set_dic(Dictionary &dic)
void set_guide(RankedGuide &guide)

Dictionary &dic()
RankedGuide &guide()

# These member functions are available only when Next() returns true.
char *key()
SizeType length()
ValueType value()

# Starts completing keys from given index and prefix.
void Start(BaseType index)
void Start(BaseType index, char *prefix)
void Start(BaseType index, char *prefix, SizeType length)

# Gets the next key.
bint Next()
Loading