Skip to content
New issue

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

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

Already on GitHub? # to your account

docs: switch theme for better readability #296

Merged
merged 2 commits into from
Apr 8, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
python -m pip install -r python/requirements.txt
python -m pip install sphinx breathe
python -m pip install sphinx breathe sphinx-wagtail-theme

- name: build python extension
run: |
Expand Down
8 changes: 4 additions & 4 deletions python/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ index.Set('key', '{"answer": 42, "condition": "always"}')
index.Flush()
# get the entry for key
m = index.Get('key')
print(m.GetValue())
print(m.value)

# match fuzzy(levenshtein distance) with max edit distance 1, exact prefix 2
m = index.GetFuzzy("kei", 1, 2)
print(m.GetMatchedString())
matches = index.GetFuzzy("kei", 1, 2)
print([m.matched_string for m in matches])
```

For more information visit http://keyvi.org
For more information visit the [docs](https://keyvidev.github.io/keyvi/index.html) and [project](http://keyvi.org) pages.
79 changes: 42 additions & 37 deletions python/src/pxds/dictionary.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ cdef extern from "keyvi/dictionary/dictionary.h" namespace "keyvi::dictionary":

cdef cppclass Dictionary:
# wrap-doc:
# Keyvi dictionary, basically a set of key values. Keyvi dictionaries
# are immutable containers, created by a previours compile run.
# Immutability has performance benefits. If you are looking for an
# updateable container, have a look at keyvi index.
# Keyvi dictionary, an immutable containers storing key value pairs, optimized
# for size, lookup performance and special lookp use cases.
# A keyvi dictionary has to be created by a previous compile run.
#
# Keyvi dictionaries allow multiple types of approximate and completion
# matches due to its internal FST based data structure.
Expand All @@ -40,57 +39,63 @@ cdef extern from "keyvi/dictionary/dictionary.h" namespace "keyvi::dictionary":
_MatchIteratorPair GetFuzzy (libcpp_utf8_string key, int32_t max_edit_distance, size_t minimum_exact_prefix) except + # wrap-as:match_fuzzy
_MatchIteratorPair GetPrefixCompletion (libcpp_utf8_string key) except + # wrap-as:complete_prefix
# wrap-doc:
# complete the given key to full matches by matching the given key as
# prefix. In case the used dictionary supports inner weights, the
# completer traverses the dictionary according to weights. If weights
# are not available the dictionary gets traversed in byte-order.
# Complete the given key to full matches(prefix matching)
# In case the used dictionary supports inner weights, the
# completer traverses the dictionary according to weights,
# otherwise byte-order.

_MatchIteratorPair GetPrefixCompletion (libcpp_utf8_string key, size_t top_n) except + # wrap-as:complete_prefix
# wrap-doc:
# complete the given key to full matches by matching the given key as
# prefix. This version of prefix completions ensure the return of the
# top name completions. Due to depth-first traversal the traverser
# Complete the given key to full matches(prefix matching)
# and return the top n completions.
# In case the used dictionary supports inner weights, the
# completer traverses the dictionary according to weights,
# otherwise byte-order.
#
# Note, due to depth-first traversal the traverser
# immediately yields results when it visits them. The results are
# neither in order nor limited to n. It is up to the caller to resort
# and truncate the lists of results.
# Only the number of top completions is guaranteed.

_MatchIteratorPair GetMultiwordCompletion (libcpp_utf8_string key) except + # wrap-as:complete_multiword
# wrap-doc:
# complete the given key to full matches by matching the given key as
# multiword. The key can consist of multiple tokens separated by space.
# For matching it gets tokenized put back together bag-of-words style.
# The dictionary must be created the same way.
# Complete the given key to full matches after whitespace tokenizing.
# In case the used dictionary supports inner weights, the
# completer traverses the dictionary according to weights. If weights
# are not available the dictionary gets traversed in byte-order.
# completer traverses the dictionary according to weights,
# otherwise byte-order.

_MatchIteratorPair GetMultiwordCompletion (libcpp_utf8_string key, size_t top_n) except + # wrap-as:complete_multiword
# wrap-doc:
# complete the given key to full matches by matching the given key as
# multiword. The key can consist of multiple tokens separated by space.
# For matching it gets tokenized put back together bag-of-words style.
# The dictionary must be created the same way.
# Complete the given key to full matches after whitespace tokenizing
# and return the top n completions.
# In case the used dictionary supports inner weights, the
# completer traverses the dictionary according to weights. If weights
# are not available the dictionary gets traversed in byte-order.
# completer traverses the dictionary according to weights,
# otherwise byte-order.
#
# Note, due to depth-first traversal the traverser
# immediately yields results when it visits them. The results are
# neither in order nor limited to n. It is up to the caller to resort
# and truncate the lists of results.
# Only the number of top completions is guaranteed.

_MatchIteratorPair GetFuzzyMultiwordCompletion (libcpp_utf8_string key, int32_t max_edit_distance) except + # wrap-as:complete_fuzzy_multiword
# wrap-doc:
# complete the given key to full matches by matching the given key as
# multiword allowing up to max_edit_distance distance(Levenshtein).
# The key can consist of multiple tokens separated by space.
# For matching it gets tokenized put back together bag-of-words style.
# The dictionary must be created the same way.
# Complete the given key to full matches after whitespace tokenizing,
# allowing up to max_edit_distance distance(Levenshtein).
# In case the used dictionary supports inner weights, the
# completer traverses the dictionary according to weights. If weights
# are not available the dictionary gets traversed in byte-order.
# completer traverses the dictionary according to weights,
# otherwise byte-order.

_MatchIteratorPair GetFuzzyMultiwordCompletion (libcpp_utf8_string key, int32_t max_edit_distance, size_t minimum_exact_prefix) except + # wrap-as:complete_fuzzy_multiword
# wrap-doc:
# complete the given key to full matches by matching the given key as
# multiword allowing up to max_edit_distance distance(Levenshtein).
# The key can consist of multiple tokens separated by space.
# For matching it gets tokenized put back together bag-of-words style.
# The dictionary must be created the same way.
# Complete the given key to full matches after whitespace tokenizing,
# allowing up to max_edit_distance distance(Levenshtein) except for
# a given exaxt prefix which must match exaxt.
# In case the used dictionary supports inner weights, the
# completer traverses the dictionary according to weights. If weights
# are not available the dictionary gets traversed in byte-order.
# completer traverses the dictionary according to weights,
# otherwise byte-order.

_MatchIteratorPair GetAllItems () # wrap-ignore
_MatchIteratorPair Lookup(libcpp_utf8_string key) # wrap-as:search
_MatchIteratorPair LookupText(libcpp_utf8_string text) # wrap-as:search_tokenized
Expand Down
8 changes: 8 additions & 0 deletions sphinx-docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.bg-primary {
background-color: #7dc466 !important;
}

/* Code snippets. */
pre {
background-color: #24292f;
}
Binary file added sphinx-docs/_static/logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 19 additions & 11 deletions sphinx-docs/conf_extra.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
from os.path import join, dirname, abspath
import alabaster
from os.path import join, dirname
import sphinx_wagtail_theme

html_theme = "alabaster"
html_theme = "sphinx_wagtail_theme"
html_theme_path = [sphinx_wagtail_theme.get_html_theme_path()]

html_static_path = [join(dirname(__file__), "_static")]

html_theme_options = {
"logo": "logo.png",
"logo_name": True,
"logo_text_align": "center",
"github_user": "keyvidev",
"github_repo": "keyvi",
"github_type": "star"
}
html_theme_options = dict(
project_name= "keyvi",
logo= "logo-white.png",
logo_alt = "keyvi",
github_url = "https://github.com/KeyviDev/keyvi/tree/master/sphinx-docs/",
footer_links = ",".join([
"Github|https://github.com/KeyviDev/keyvi",
"Pypi|https://pypi.org/project/keyvi/",
]),
)

html_show_copyright = False
html_last_updated_fmt = "%b %d, %Y"

html_css_files = ["custom.css"]
Loading