spaCy integration #254
Replies: 2 comments 3 replies
-
Wow it is super cool to see some use of the C-API. I never got around to write docs for it, but it is not hard to use. Similar to numpy this package provides you with an include path for headers/cython files you need to specify when building. import rapidfuzz
rapidfuzz.get_include() The general concept of the API is that each function has an attribute which includes a pycapsule with all relevant function pointers.
ctypedef struct RF_Scorer:
uint32_t version
RF_KwargsInit kwargs_init
RF_GetScorerFlags get_scorer_flags
RF_ScorerFuncInit scorer_func_init
In your case it should be enough to set
I do use this api myself for the implementation of the I hope this helped to give a general overview of the API. I you have any additional questions feel free to ask :). In addition I am happy to help with the PR review in spacy. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the overview, Max, but I think this might be beyond me right now. My cpp is rusty and I have never used Cython before. |
Beta Was this translation helpful? Give feedback.
-
I'm attempting to use rapidfuzz directly in spaCy explosion/spaCy#11359 but am calling Python functions from Cython, requiring
with gil
.Is there any way to call rapidfuzz Cython functions directly, to avoid the need to convert Python objects?
(#202 mentions [the](https://github.com/maxbachmann/rapidfuzz_capi but I wasn't able to find any docs on using it)
Beta Was this translation helpful? Give feedback.
All reactions