New user here, please be gentle.
we are looking to implement a piece of python code in c++, but it involves some intricate unicode library called unicodedata, in particular this function
unicodedata.category('A') # 'L'etter, 'u'ppercase
'Lu'
Any chance that this can be readily achieved in c++? Would embedding compiled python code in c++ be worthwhile, assuming we want to do this in the context of online tensorflow model serving? Thanks!
Just stick the output of this Python code into a C++ source file:
(If you are still using Python 2.x instead of 3.x, replace
chr
withunichr
.)You now have a convenient lookup table of Unicode character categories to use in your C++ programs.