diff options
author | Taku Kudo <taku@google.com> | 2020-10-21 19:38:56 +0300 |
---|---|---|
committer | Taku Kudo <taku@google.com> | 2020-10-21 19:38:56 +0300 |
commit | d20da5aa8cd785563e415dcfbefb130513a698ce (patch) | |
tree | 03279fb6cc78963c292a779ee8b138fea577afee | |
parent | 195a2cc4fbf06988a9b04f8985c538e202998ca3 (diff) |
move sentencepiece python moduel to sub directory.
-rwxr-xr-x | python/setup.py | 11 | ||||
-rw-r--r-- | python/src/sentencepiece/__init__.py (renamed from python/sentencepiece.py) | 0 | ||||
-rwxr-xr-x | python/src/sentencepiece/_sentencepiece.cpython-38-x86_64-linux-gnu.so | bin | 0 -> 3684928 bytes | |||
-rw-r--r-- | python/src/sentencepiece/sentencepiece.i (renamed from python/sentencepiece.i) | 0 | ||||
-rw-r--r-- | python/src/sentencepiece/sentencepiece_model_pb2.py (renamed from python/sentencepiece_model_pb2.py) | 0 | ||||
-rw-r--r-- | python/src/sentencepiece/sentencepiece_pb2.py (renamed from python/sentencepiece_pb2.py) | 0 | ||||
-rw-r--r-- | python/src/sentencepiece/sentencepiece_wrap.cxx (renamed from python/sentencepiece_wrap.cxx) | 0 | ||||
-rw-r--r-- | src/normalizer.h | 3 |
8 files changed, 9 insertions, 5 deletions
diff --git a/python/setup.py b/python/setup.py index 3120d86..e223fea 100755 --- a/python/setup.py +++ b/python/setup.py @@ -88,14 +88,15 @@ if os.name == 'nt': '..\\build\\root\\lib\\sentencepiece_train.lib' ] SENTENCEPIECE_EXT = Extension( - '_sentencepiece', - sources=['sentencepiece_wrap.cxx'], + 'sentencepiece._sentencepiece', + sources=['src/sentencepiece/sentencepiece_wrap.cxx'], extra_compile_args=cflags, extra_link_args=libs) cmdclass = {} else: SENTENCEPIECE_EXT = Extension( - '_sentencepiece', sources=['sentencepiece_wrap.cxx']) + 'sentencepiece._sentencepiece', + sources=['src/sentencepiece/sentencepiece_wrap.cxx']) cmdclass = {'build_ext': build_ext} setup( @@ -106,11 +107,13 @@ setup( long_description=long_description(), long_description_content_type='text/markdown', version=version(), + package_dir={'': 'src'}, url='https://github.com/google/sentencepiece', license='Apache', platforms='Unix', py_modules=[ - 'sentencepiece', 'sentencepiece_model_pb2', 'sentencepiece_pb2' + 'sentencepiece/__init__', 'sentencepiece/sentencepiece_model_pb2', + 'sentencepiece/sentencepiece_pb2' ], ext_modules=[SENTENCEPIECE_EXT], cmdclass=cmdclass, diff --git a/python/sentencepiece.py b/python/src/sentencepiece/__init__.py index e704a2a..e704a2a 100644 --- a/python/sentencepiece.py +++ b/python/src/sentencepiece/__init__.py diff --git a/python/src/sentencepiece/_sentencepiece.cpython-38-x86_64-linux-gnu.so b/python/src/sentencepiece/_sentencepiece.cpython-38-x86_64-linux-gnu.so Binary files differnew file mode 100755 index 0000000..30c3c3c --- /dev/null +++ b/python/src/sentencepiece/_sentencepiece.cpython-38-x86_64-linux-gnu.so diff --git a/python/sentencepiece.i b/python/src/sentencepiece/sentencepiece.i index 04f3af0..04f3af0 100644 --- a/python/sentencepiece.i +++ b/python/src/sentencepiece/sentencepiece.i diff --git a/python/sentencepiece_model_pb2.py b/python/src/sentencepiece/sentencepiece_model_pb2.py index 084b896..084b896 100644 --- a/python/sentencepiece_model_pb2.py +++ b/python/src/sentencepiece/sentencepiece_model_pb2.py diff --git a/python/sentencepiece_pb2.py b/python/src/sentencepiece/sentencepiece_pb2.py index 8347974..8347974 100644 --- a/python/sentencepiece_pb2.py +++ b/python/src/sentencepiece/sentencepiece_pb2.py diff --git a/python/sentencepiece_wrap.cxx b/python/src/sentencepiece/sentencepiece_wrap.cxx index bd7f6a1..bd7f6a1 100644 --- a/python/sentencepiece_wrap.cxx +++ b/python/src/sentencepiece/sentencepiece_wrap.cxx diff --git a/src/normalizer.h b/src/normalizer.h index c31864d..3fce3ed 100644 --- a/src/normalizer.h +++ b/src/normalizer.h @@ -22,6 +22,7 @@ #include <vector> #include "common.h" +#incldue "util.h" #include "sentencepiece_model.pb.h" #include "sentencepiece_processor.h" #include "third_party/absl/strings/string_view.h" @@ -146,7 +147,7 @@ class Normalizer { // "_hello" and "_world". const bool treat_whitespace_as_suffix_ = false; -#ifndef __BIG_ENDIAN__ +#ifdef IS_BIG_ENDIAN // Stores the blob for TRIE encoded in big-endian. std::string precompiled_charsmap_buffer_; #endif |