Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2020-10-21 19:38:56 +0300
committerTaku Kudo <taku@google.com>2020-10-21 19:38:56 +0300
commitd20da5aa8cd785563e415dcfbefb130513a698ce (patch)
tree03279fb6cc78963c292a779ee8b138fea577afee
parent195a2cc4fbf06988a9b04f8985c538e202998ca3 (diff)
move sentencepiece python moduel to sub directory.
-rwxr-xr-xpython/setup.py11
-rw-r--r--python/src/sentencepiece/__init__.py (renamed from python/sentencepiece.py)0
-rwxr-xr-xpython/src/sentencepiece/_sentencepiece.cpython-38-x86_64-linux-gnu.sobin0 -> 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.h3
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
new file mode 100755
index 0000000..30c3c3c
--- /dev/null
+++ b/python/src/sentencepiece/_sentencepiece.cpython-38-x86_64-linux-gnu.so
Binary files differ
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