Commit 0869cacb9a0dd359f1d2f25060ebef7923ba8c74
1 parent
007a1589
- w miarę ostateczna wersja zawierająca API dla Javy i Pythona
git-svn-id: svn://svn.nlp.ipipan.waw.pl/morfeusz/morfeusz@65 ff4e3ee1-f430-4e82-ade0-24591c43f1fd
Showing
11 changed files
with
1149 additions
and
92 deletions
CMakeLists.txt
... | ... | @@ -5,9 +5,19 @@ set (Morfeusz_VERSION_MAJOR 0) |
5 | 5 | set (Morfeusz_VERSION_MINOR 1) |
6 | 6 | set (CMAKE_BUILD_TYPE "Release") |
7 | 7 | |
8 | -set (CMAKE_CXX_FLAGS "-std=c++98 -Wall -pedantic -Wcast-align -Wextra -Wmissing-noreturn -Wconversion -Wcast-qual -Wcast-align") | |
8 | +if (NOT CMAKE_CROSSCOMPILING) | |
9 | + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -pedantic -Wcast-align -Wextra -Wmissing-noreturn -Wconversion -Wcast-qual -Wcast-align") | |
10 | +endif () | |
9 | 11 | # set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") |
10 | 12 | |
13 | +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |
14 | + set (CMAKE_SHARED_LIBRARY_PREFIX "") | |
15 | + # here is some magic - must statically link libstdc++ and libgcc | |
16 | + # but exclude libgcc_eh.a as it causes "multiple definition of (...)" errors | |
17 | + set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc -Wl,--exclude-libs,libgcc_eh.a") | |
18 | + set (CMAKE_EXE_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc") | |
19 | +endif () | |
20 | + | |
11 | 21 | enable_testing() |
12 | 22 | |
13 | 23 | file (COPY fsabuilder testfiles pymorfeusz DESTINATION .) |
... | ... | @@ -21,7 +31,7 @@ include_directories("${PROJECT_BINARY_DIR}" ) |
21 | 31 | |
22 | 32 | add_subdirectory (morfeusz) |
23 | 33 | |
24 | -set (PYMORFEUSZ _morfeusz) | |
34 | +set (PYMORFEUSZ pymorfeusz) | |
25 | 35 | set (JMORFEUSZ jmorfeusz) |
26 | 36 | |
27 | 37 | ###### add some dependencies for SWIG modules ###### |
... | ... | @@ -33,23 +43,22 @@ add_dependencies (${JMORFEUSZ} morfeusz) |
33 | 43 | # find out library suffix (CMAKE_JAVA_LIBRARY_SUFFIX) |
34 | 44 | if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
35 | 45 | set (CMAKE_JAVA_LIBRARY_SUFFIX ".jnilib") |
36 | -else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
46 | +else () | |
37 | 47 | set (CMAKE_JAVA_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) |
38 | -endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
39 | - | |
40 | -# copy jmorfeusz to java source tree | |
41 | -add_custom_target (copy-jmorfeusz-libs ALL | |
42 | - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/morfeusz/java/${CMAKE_SHARED_LIBRARY_PREFIX}jmorfeusz${CMAKE_JAVA_LIBRARY_SUFFIX} ${PROJECT_SOURCE_DIR}/jmorfeusz/src/main/native | |
43 | - # COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/morfeusz/${CMAKE_SHARED_LIBRARY_PREFIX}morfeusz${CMAKE_SHARED_LIBRARY_SUFFIX} ${PROJECT_SOURCE_DIR}/jmorfeusz/src/main/native | |
44 | - DEPENDS ${JMORFEUSZ}) | |
48 | +endif () | |
45 | 49 | |
46 | 50 | # build jmorfeusz |
47 | -# add_custom_command(TARGET all POST_BUILD mvn package -PotherOutputDir -DoutputDir=${PROJECT_BINARY_DIR}/jmorfeusz/target WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/jmorfeusz) | |
48 | 51 | add_custom_target ( jmorfeusz-maven-package ALL |
49 | 52 | COMMAND mvn package -PotherOutputDir -DoutputDir=${PROJECT_BINARY_DIR}/jmorfeusz -DskipTests=true |
50 | - DEPENDS copy-jmorfeusz-libs | |
53 | + DEPENDS ${JMORFEUSZ} | |
51 | 54 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/jmorfeusz) |
52 | 55 | |
56 | +# copy jmorfeusz to java source tree | |
57 | +add_custom_target (copy-jmorfeusz-libs ALL | |
58 | + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/morfeusz/java/${CMAKE_SHARED_LIBRARY_PREFIX}jmorfeusz${CMAKE_JAVA_LIBRARY_SUFFIX} ${PROJECT_BINARY_DIR}/jmorfeusz/ | |
59 | + # COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/morfeusz/${CMAKE_SHARED_LIBRARY_PREFIX}morfeusz${CMAKE_SHARED_LIBRARY_SUFFIX} ${PROJECT_SOURCE_DIR}/jmorfeusz/src/main/native | |
60 | + DEPENDS jmorfeusz-maven-package) | |
61 | + | |
53 | 62 | ########## PYTHON ########## |
54 | 63 | |
55 | 64 | # find out library suffix |
... | ... | @@ -57,13 +66,13 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
57 | 66 | set (CMAKE_PYTHON_LIBRARY_SUFFIX ".so") |
58 | 67 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
59 | 68 | set (CMAKE_PYTHON_LIBRARY_SUFFIX ".pyd") |
60 | -else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
69 | +else () | |
61 | 70 | set (CMAKE_PYTHON_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) |
62 | -endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
71 | +endif () | |
63 | 72 | |
64 | 73 | # copy python->c++ bindings |
65 | 74 | add_custom_target (copy-pymorfeusz-libs ALL |
66 | - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/morfeusz/python/${PYMORFEUSZ}${CMAKE_PYTHON_LIBRARY_SUFFIX} ${PROJECT_BINARY_DIR}/pymorfeusz | |
75 | + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/morfeusz/python/_morfeusz${CMAKE_PYTHON_LIBRARY_SUFFIX} ${PROJECT_BINARY_DIR}/pymorfeusz | |
67 | 76 | DEPENDS ${PYMORFEUSZ}) |
68 | 77 | add_custom_target (copy-pymorfeusz-wrapper ALL |
69 | 78 | COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/morfeusz/python/morfeusz.py ${PROJECT_BINARY_DIR}/pymorfeusz |
... | ... | @@ -78,12 +87,12 @@ macro (test_build_and_recognize fname method) |
78 | 87 | add_test (TestRecognize-${method}-${fname} morfeusz/test_recognize_dict /tmp/test-${method}-${fname}.fsa testfiles/${fname}) |
79 | 88 | # add_test (TestNOTRecognize-${method}-${fname} fsa/test_not_recognize /tmp/test-${method}-${fname}.fsa testfiles/out_of_dict) |
80 | 89 | # add_test (TestSpeed-${method}-${fname} fsa/test_speed /tmp/test-${method}-${fname}.fsa testfiles/speed_test_data) |
81 | -endmacro (test_build_and_recognize) | |
90 | +endmacro () | |
82 | 91 | |
83 | 92 | macro (test_result_equals inputFilename requiredOutputFilename encoding) |
84 | 93 | # add_test (TestBuild4ResultEquals-${dictFilename}-${requiredOutputFilename} python fsabuilder/fsa/buildfsa.py -i ${dictFilename} -o /tmp/test.fsa --tagset-file=testfiles/polimorf.tagset --output-format=BINARY --serialization-method=SIMPLE) |
85 | 94 | add_test (TestResultEquals-${inputFilename}-${requiredOutputFilename} morfeusz/test_result_equals ${inputFilename} ${requiredOutputFilename} ${encoding}) |
86 | -endmacro (test_result_equals) | |
95 | +endmacro () | |
87 | 96 | |
88 | 97 | test_build_and_recognize(PoliMorfSmall.tab SIMPLE) |
89 | 98 | test_build_and_recognize(PoliMorfSmall.tab V1) |
... | ... |
jmorfeusz/pom.xml
... | ... | @@ -56,29 +56,6 @@ |
56 | 56 | </archive> |
57 | 57 | </configuration> |
58 | 58 | </plugin> |
59 | - | |
60 | - <plugin> | |
61 | - <groupId>org.apache.maven.plugins</groupId> | |
62 | - <artifactId>maven-assembly-plugin</artifactId> | |
63 | - <executions> | |
64 | - <execution> | |
65 | - <id>create-my-bundle</id> | |
66 | - <phase>package</phase> | |
67 | - <goals> | |
68 | - <goal>single</goal> | |
69 | - </goals> | |
70 | - <configuration> | |
71 | - <finalName>JMorfeusz-${os.name}-${os.arch}</finalName> | |
72 | - <descriptor>src/main/assembly/bin.xml</descriptor> | |
73 | - <archive> | |
74 | - <manifest> | |
75 | - <mainClass>pl.waw.ipipan.morfeusz.App</mainClass> | |
76 | - </manifest> | |
77 | - </archive> | |
78 | - </configuration> | |
79 | - </execution> | |
80 | - </executions> | |
81 | - </plugin> | |
82 | 59 | |
83 | 60 | <plugin> |
84 | 61 | <artifactId>maven-resources-plugin</artifactId> |
... | ... | @@ -95,7 +72,7 @@ |
95 | 72 | <outputDirectory>${project.build.directory}</outputDirectory> |
96 | 73 | <resources> |
97 | 74 | <resource> |
98 | - <directory>src/main/native</directory> | |
75 | + <directory>src/main/resources</directory> | |
99 | 76 | <!--<filtering>true</filtering>--> |
100 | 77 | </resource> |
101 | 78 | </resources> |
... | ... |
jmorfeusz/src/main/native/libjmorfeusz.dll deleted
No preview for this file type
jmorfeusz/src/main/native/libjmorfeusz.so deleted
No preview for this file type
morfeusz/CMakeLists.txt
... | ... | @@ -26,14 +26,7 @@ target_link_libraries (test_recognize_dict libmorfeusz) |
26 | 26 | |
27 | 27 | if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
28 | 28 | target_link_libraries (libmorfeusz ws2_32) |
29 | - | |
30 | - # here is the magic - must statically link libstdc++ and libgcc | |
31 | - # but exclude libgcc_eh.a as it causes "multiple definition of (...)" errors | |
32 | - | |
33 | - set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc -Wl,--exclude-libs,libgcc_eh.a") | |
34 | - set (CMAKE_EXE_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc") | |
35 | - set (CMAKE_CXX_FLAGS "-std=c++0x -Wall -pedantic") | |
36 | -endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |
29 | +endif () | |
37 | 30 | |
38 | 31 | add_subdirectory (java) |
39 | 32 | add_subdirectory (python) |
... | ... |
morfeusz/Toolchain-linux32.cmake
1 | 1 | |
2 | -SET(CMAKE_SYSTEM_NAME Linux) | |
3 | -SET(CMAKE_SYSTEM_VERSION 1) | |
4 | -SET(CMAKE_C_COMPILER gcc -m32) | |
5 | -SET(CMAKE_CXX_COMPILER g++ -m32) | |
2 | +set (CMAKE_SYSTEM_NAME Linux) | |
3 | +set (CMAKE_SYSTEM_VERSION 1) | |
4 | +set (CMAKE_C_COMPILER gcc -m32) | |
5 | +set (CMAKE_CXX_COMPILER g++ -m32) | |
6 | 6 | |
7 | 7 | set (JAVA_ROOT /mnt/storage/crossmorfeusz/linux32/jdk1.7.0_45) |
8 | 8 | set (PYTHON_ROOT /mnt/storage/crossmorfeusz/linux32/python) |
... | ... | @@ -18,4 +18,4 @@ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) |
18 | 18 | set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) |
19 | 19 | |
20 | 20 | set (JAVA_INCLUDE_PATH ${JAVA_ROOT}/include) |
21 | -set (JAVA_INCLUDE_PATH2 ${JAVA_ROOT}/include/linux) | |
22 | 21 | \ No newline at end of file |
22 | +set (JAVA_INCLUDE_PATH2 ${JAVA_ROOT}/include/linux) | |
... | ... |
morfeusz/Toolchain-win32.cmake
1 | 1 | |
2 | -SET(CMAKE_SYSTEM_NAME Windows) | |
3 | -SET(CMAKE_SYSTEM_VERSION 1) | |
4 | -SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) | |
5 | -SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) | |
6 | -SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) | |
2 | +set (CMAKE_SYSTEM_NAME Windows) | |
3 | +set (CMAKE_SYSTEM_VERSION 1) | |
4 | +set (CMAKE_C_COMPILER i686-w64-mingw32-gcc) | |
5 | +set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++) | |
6 | +set (CMAKE_RC_COMPILER i686-w64-mingw32-windres) | |
7 | 7 | |
8 | 8 | # here is the target environment located |
9 | 9 | set (WIN32_ROOT /mnt/storage/crossmorfeusz/windows32) |
... | ... | @@ -12,9 +12,11 @@ set (JAVA_ROOT ${WIN32_ROOT}/Java/jdk1.7.0_45) |
12 | 12 | set (CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ${JAVA_ROOT} ${PYTHON_ROOT}) |
13 | 13 | set (CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${PYTHON_ROOT}/libs) |
14 | 14 | |
15 | +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -I${JAVA_ROOT}/include/win32") | |
16 | + | |
15 | 17 | # adjust the default behaviour of the FIND_XXX() commands: |
16 | 18 | # search headers and libraries in the target environment, search |
17 | 19 | # programs in the host environment |
18 | -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
19 | -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
20 | -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
21 | 20 | \ No newline at end of file |
21 | +set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
22 | +set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
23 | +set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
... | ... |
morfeusz/Toolchain-win64.cmake
... | ... | @@ -12,9 +12,11 @@ set (JAVA_ROOT ${WIN64_ROOT}/Java/jdk1.7.0_45) |
12 | 12 | set (CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ${JAVA_ROOT} ${PYTHON_ROOT}) |
13 | 13 | set (CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${PYTHON_ROOT}/libs) |
14 | 14 | |
15 | +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -I${JAVA_ROOT}/include/win32") | |
16 | + | |
15 | 17 | # adjust the default behaviour of the FIND_XXX() commands: |
16 | 18 | # search headers and libraries in the target environment, search |
17 | 19 | # programs in the host environment |
18 | -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
19 | -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
20 | -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
20 | +set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
21 | +set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
22 | +set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
... | ... |
morfeusz/java/CMakeLists.txt
1 | - | |
2 | 1 | # SWIG |
3 | 2 | #set(CMAKE_SWIG_OUTDIR swig) |
4 | -FIND_PACKAGE(SWIG REQUIRED) | |
3 | +#FIND_PACKAGE(SWIG REQUIRED) | |
5 | 4 | FIND_PACKAGE(JNI REQUIRED) |
6 | -INCLUDE(${SWIG_USE_FILE}) | |
5 | +#INCLUDE(${SWIG_USE_FILE}) | |
7 | 6 | include(UseJava) |
8 | 7 | |
9 | 8 | # SWIG Java |
10 | -INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH}) | |
11 | -INCLUDE_DIRECTORIES(..) | |
9 | +include_directories (${JAVA_INCLUDE_PATH}) | |
10 | +include_directories (${JAVA_INCLUDE_PATH2}) | |
11 | +include_directories (..) | |
12 | + | |
13 | +set (SWIG_JAVA_OUTFILE swigJAVA.cpp) | |
14 | +# set (JAVA_WRAPPER_FILE ${CMAKE_SHARED_LIBRARY_PREFIX}morfeusz${CMAKE_SHARED_LIBRARY_SUFFIX}) | |
15 | +add_custom_command ( | |
16 | + OUTPUT ${SWIG_JAVA_OUTFILE} | |
17 | + COMMAND swig -java -c++ -package pl.waw.ipipan.morfeusz -o ${SWIG_JAVA_OUTFILE} -outdir ${CMAKE_SOURCE_DIR}/jmorfeusz/src/main/java/pl/waw/ipipan/morfeusz ${CMAKE_SOURCE_DIR}/morfeusz/morfeusz.i | |
18 | + DEPENDS libmorfeusz | |
19 | +) | |
20 | +#set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc") | |
21 | +add_library (jmorfeusz SHARED ${SWIG_JAVA_OUTFILE}) | |
22 | +target_link_libraries (jmorfeusz ${JAVA_LIBRARIES} libmorfeusz) | |
23 | +add_dependencies (jmorfeusz ${SWIG_JAVA_OUTFILE}) | |
24 | + | |
25 | +#set (CMAKE_SWIG_FLAGS -package pl.waw.ipipan.morfeusz) | |
26 | +#set (CMAKE_SWIG_OUTDIR ${CMAKE_SOURCE_DIR}/jmorfeusz/src/main/java/pl/waw/ipipan/morfeusz) | |
12 | 27 | |
13 | -set (CMAKE_SWIG_FLAGS -package pl.waw.ipipan.morfeusz) | |
14 | -set (CMAKE_SWIG_OUTDIR ${CMAKE_SOURCE_DIR}/jmorfeusz/src/main/java/pl/waw/ipipan/morfeusz) | |
28 | +#set_source_files_properties (../morfeusz.i PROPERTIES CPLUSPLUS ON) | |
29 | +#SWIG_ADD_MODULE(jmorfeusz java ../morfeusz.i) | |
30 | +#SWIG_LINK_LIBRARIES(jmorfeusz ${JAVA_LIBRARIES}) | |
31 | +#SWIG_LINK_LIBRARIES(jmorfeusz libmorfeusz) | |
15 | 32 | |
16 | -set_source_files_properties (../morfeusz.i PROPERTIES CPLUSPLUS ON) | |
17 | -SWIG_ADD_MODULE(jmorfeusz java ../morfeusz.i) | |
18 | -SWIG_LINK_LIBRARIES(jmorfeusz ${JAVA_LIBRARIES}) | |
19 | -SWIG_LINK_LIBRARIES(jmorfeusz libmorfeusz) | |
33 | +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |
34 | + set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc -D_JNI_IMPLEMENTATION_ -Wl,--kill-at") | |
35 | +endif () | |
20 | 36 | |
21 | -set (CMAKE_SHARED_LINKER_FLAGS "") | |
22 | -set (CMAKE_EXE_LINKER_FLAGS "") | |
23 | -set (CMAKE_CXX_FLAGS "-O2") | |
37 | +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
38 | + set (CMAKE_SHARED_LIBRARY_SUFFIX ".jnilib") | |
39 | +endif () | |
... | ... |
morfeusz/python/CMakeLists.txt
... | ... | @@ -7,20 +7,49 @@ INCLUDE(${SWIG_USE_FILE}) |
7 | 7 | |
8 | 8 | # SWIG Java |
9 | 9 | INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) |
10 | -#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) | |
11 | 10 | INCLUDE_DIRECTORIES(..) |
12 | 11 | |
13 | -SET(CMAKE_SWIG_FLAGS "") | |
12 | +set (SWIG_PYTHON_OUTFILE swigPYTHON.cpp) | |
13 | +# set (JAVA_WRAPPER_FILE ${CMAKE_SHARED_LIBRARY_PREFIX}morfeusz${CMAKE_SHARED_LIBRARY_SUFFIX}) | |
14 | +add_custom_command ( | |
15 | + OUTPUT ${SWIG_PYTHON_OUTFILE} | |
16 | + COMMAND swig -python -c++ -o ${SWIG_PYTHON_OUTFILE} ${CMAKE_SOURCE_DIR}/morfeusz/morfeusz.i | |
17 | + DEPENDS libmorfeusz | |
18 | +) | |
19 | +#set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc") | |
20 | +add_library (pymorfeusz SHARED ${SWIG_PYTHON_OUTFILE}) | |
21 | +target_link_libraries (pymorfeusz ${PYTHON_LIBRARIES} libmorfeusz) | |
22 | +add_dependencies (pymorfeusz ${SWIG_PYTHON_OUTFILE}) | |
23 | +set (CMAKE_SHARED_LIBRARY_PREFIX "") | |
24 | +set_target_properties (pymorfeusz PROPERTIES OUTPUT_NAME "_morfeusz") | |
14 | 25 | |
15 | -SET_SOURCE_FILES_PROPERTIES(../morfeusz.i PROPERTIES CPLUSPLUS ON) | |
16 | -SWIG_ADD_MODULE(morfeusz python ../morfeusz.i) | |
17 | -SWIG_LINK_LIBRARIES(morfeusz ${PYTHON_LIBRARIES}) | |
18 | -SWIG_LINK_LIBRARIES(morfeusz libmorfeusz) | |
26 | +#set (CMAKE_SWIG_FLAGS -package pl.waw.ipipan.morfeusz) | |
27 | +#set (CMAKE_SWIG_OUTDIR ${CMAKE_SOURCE_DIR}/jmorfeusz/src/main/java/pl/waw/ipipan/morfeusz) | |
19 | 28 | |
20 | -#set (CMAKE_SHARED_LINKER_FLAGS "") | |
21 | -#set (CMAKE_EXE_LINKER_FLAGS "") | |
22 | -#if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |
23 | -# set (CMAKE_CXX_FLAGS "-D MS_WIN64 -O2") | |
24 | -#else () | |
25 | -# set (CMAKE_CXX_FLAGS "-O2") | |
26 | -#endif () | |
27 | 29 | \ No newline at end of file |
30 | +#set_source_files_properties (../morfeusz.i PROPERTIES CPLUSPLUS ON) | |
31 | +#SWIG_ADD_MODULE(jmorfeusz java ../morfeusz.i) | |
32 | +#SWIG_LINK_LIBRARIES(jmorfeusz ${JAVA_LIBRARIES}) | |
33 | +#SWIG_LINK_LIBRARIES(jmorfeusz libmorfeusz) | |
34 | + | |
35 | +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |
36 | + | |
37 | + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D MS_WIN64") | |
38 | + set (CMAKE_SHARED_LIBRARY_SUFFIX ".pyd") | |
39 | + set (CMAKE_SHARED_LINKER_FLAGS "-s -Os -static-libstdc++ -static-libgcc -lpython27") | |
40 | + | |
41 | +elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
42 | + | |
43 | + set (CMAKE_SHARED_LIBRARY_SUFFIX ".so") | |
44 | + | |
45 | +endif () | |
46 | + | |
47 | +#~ SET(CMAKE_SWIG_FLAGS "") | |
48 | +#~ | |
49 | +#~ SET_SOURCE_FILES_PROPERTIES(../morfeusz.i PROPERTIES CPLUSPLUS ON) | |
50 | +#~ SWIG_ADD_MODULE(morfeusz python ../morfeusz.i) | |
51 | +#~ SWIG_LINK_LIBRARIES(morfeusz ${PYTHON_LIBRARIES}) | |
52 | +#~ SWIG_LINK_LIBRARIES(morfeusz libmorfeusz) | |
53 | +#~ | |
54 | +#~ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |
55 | + #~ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D MS_WIN64") | |
56 | +#~ endif () | |
... | ... |
pymorfeusz/morfeusz.py
0 → 100644
1 | +# This file was automatically generated by SWIG (http://www.swig.org). | |
2 | +# Version 2.0.4 | |
3 | +# | |
4 | +# Do not make changes to this file unless you know what you are doing--modify | |
5 | +# the SWIG interface file instead. | |
6 | + | |
7 | + | |
8 | + | |
9 | +from sys import version_info | |
10 | +if version_info >= (2,6,0): | |
11 | + def swig_import_helper(): | |
12 | + from os.path import dirname | |
13 | + import imp | |
14 | + fp = None | |
15 | + try: | |
16 | + fp, pathname, description = imp.find_module('_morfeusz', [dirname(__file__)]) | |
17 | + except ImportError: | |
18 | + import _morfeusz | |
19 | + return _morfeusz | |
20 | + if fp is not None: | |
21 | + try: | |
22 | + _mod = imp.load_module('_morfeusz', fp, pathname, description) | |
23 | + finally: | |
24 | + fp.close() | |
25 | + return _mod | |
26 | + _morfeusz = swig_import_helper() | |
27 | + del swig_import_helper | |
28 | +else: | |
29 | + import _morfeusz | |
30 | +del version_info | |
31 | +try: | |
32 | + _swig_property = property | |
33 | +except NameError: | |
34 | + pass # Python < 2.2 doesn't have 'property'. | |
35 | +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): | |
36 | + if (name == "thisown"): return self.this.own(value) | |
37 | + if (name == "this"): | |
38 | + if type(value).__name__ == 'SwigPyObject': | |
39 | + self.__dict__[name] = value | |
40 | + return | |
41 | + method = class_type.__swig_setmethods__.get(name,None) | |
42 | + if method: return method(self,value) | |
43 | + if (not static): | |
44 | + self.__dict__[name] = value | |
45 | + else: | |
46 | + raise AttributeError("You cannot add attributes to %s" % self) | |
47 | + | |
48 | +def _swig_setattr(self,class_type,name,value): | |
49 | + return _swig_setattr_nondynamic(self,class_type,name,value,0) | |
50 | + | |
51 | +def _swig_getattr(self,class_type,name): | |
52 | + if (name == "thisown"): return self.this.own() | |
53 | + method = class_type.__swig_getmethods__.get(name,None) | |
54 | + if method: return method(self) | |
55 | + raise AttributeError(name) | |
56 | + | |
57 | +def _swig_repr(self): | |
58 | + try: strthis = "proxy of " + self.this.__repr__() | |
59 | + except: strthis = "" | |
60 | + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) | |
61 | + | |
62 | +try: | |
63 | + _object = object | |
64 | + _newclass = 1 | |
65 | +except AttributeError: | |
66 | + class _object : pass | |
67 | + _newclass = 0 | |
68 | + | |
69 | + | |
70 | +class SwigPyIterator(_object): | |
71 | + """Proxy of C++ swig::SwigPyIterator class""" | |
72 | + __swig_setmethods__ = {} | |
73 | + __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value) | |
74 | + __swig_getmethods__ = {} | |
75 | + __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name) | |
76 | + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") | |
77 | + __repr__ = _swig_repr | |
78 | + __swig_destroy__ = _morfeusz.delete_SwigPyIterator | |
79 | + __del__ = lambda self : None; | |
80 | + def value(self): | |
81 | + """ | |
82 | + value(self) -> PyObject | |
83 | + Parameters: | |
84 | + self: swig::SwigPyIterator const * value | |
85 | + | |
86 | + | |
87 | + | |
88 | + | |
89 | + """ | |
90 | + return _morfeusz.SwigPyIterator_value(self) | |
91 | + | |
92 | + def incr(self, n = 1): | |
93 | + """ | |
94 | + incr(self, n = 1) -> SwigPyIterator | |
95 | + Parameters: | |
96 | + n: size_t value | |
97 | + | |
98 | + n: size_t value | |
99 | + | |
100 | + n: size_t value | |
101 | + | |
102 | + n: size_t value | |
103 | + | |
104 | + incr(self) -> SwigPyIterator | |
105 | + Parameters: | |
106 | + self: swig::SwigPyIterator * value | |
107 | + | |
108 | + | |
109 | + """ | |
110 | + return _morfeusz.SwigPyIterator_incr(self, n) | |
111 | + | |
112 | + def decr(self, n = 1): | |
113 | + """ | |
114 | + decr(self, n = 1) -> SwigPyIterator | |
115 | + Parameters: | |
116 | + n: size_t value | |
117 | + | |
118 | + n: size_t value | |
119 | + | |
120 | + n: size_t value | |
121 | + | |
122 | + n: size_t value | |
123 | + | |
124 | + decr(self) -> SwigPyIterator | |
125 | + Parameters: | |
126 | + self: swig::SwigPyIterator * value | |
127 | + | |
128 | + | |
129 | + """ | |
130 | + return _morfeusz.SwigPyIterator_decr(self, n) | |
131 | + | |
132 | + def distance(self, *args): | |
133 | + """ | |
134 | + distance(self, x) -> ptrdiff_t | |
135 | + Parameters: | |
136 | + self: swig::SwigPyIterator const * value | |
137 | + x: swig::SwigPyIterator const & value | |
138 | + | |
139 | + x: swig::SwigPyIterator const & value | |
140 | + | |
141 | + """ | |
142 | + return _morfeusz.SwigPyIterator_distance(self, *args) | |
143 | + | |
144 | + def equal(self, *args): | |
145 | + """ | |
146 | + equal(self, x) -> bool | |
147 | + Parameters: | |
148 | + self: swig::SwigPyIterator const * value | |
149 | + x: swig::SwigPyIterator const & value | |
150 | + | |
151 | + x: swig::SwigPyIterator const & value | |
152 | + | |
153 | + """ | |
154 | + return _morfeusz.SwigPyIterator_equal(self, *args) | |
155 | + | |
156 | + def copy(self): | |
157 | + """ | |
158 | + copy(self) -> SwigPyIterator | |
159 | + Parameters: | |
160 | + self: swig::SwigPyIterator const * value | |
161 | + | |
162 | + | |
163 | + | |
164 | + | |
165 | + """ | |
166 | + return _morfeusz.SwigPyIterator_copy(self) | |
167 | + | |
168 | + def next(self): | |
169 | + """ | |
170 | + next(self) -> PyObject | |
171 | + Parameters: | |
172 | + self: swig::SwigPyIterator * value | |
173 | + | |
174 | + | |
175 | + | |
176 | + | |
177 | + """ | |
178 | + return _morfeusz.SwigPyIterator_next(self) | |
179 | + | |
180 | + def __next__(self): | |
181 | + """ | |
182 | + __next__(self) -> PyObject | |
183 | + Parameters: | |
184 | + self: swig::SwigPyIterator * value | |
185 | + | |
186 | + | |
187 | + | |
188 | + | |
189 | + """ | |
190 | + return _morfeusz.SwigPyIterator___next__(self) | |
191 | + | |
192 | + def previous(self): | |
193 | + """ | |
194 | + previous(self) -> PyObject | |
195 | + Parameters: | |
196 | + self: swig::SwigPyIterator * value | |
197 | + | |
198 | + | |
199 | + | |
200 | + | |
201 | + """ | |
202 | + return _morfeusz.SwigPyIterator_previous(self) | |
203 | + | |
204 | + def advance(self, *args): | |
205 | + """ | |
206 | + advance(self, n) -> SwigPyIterator | |
207 | + Parameters: | |
208 | + self: swig::SwigPyIterator * value | |
209 | + n: ptrdiff_t value | |
210 | + | |
211 | + n: ptrdiff_t value | |
212 | + | |
213 | + """ | |
214 | + return _morfeusz.SwigPyIterator_advance(self, *args) | |
215 | + | |
216 | + def __eq__(self, *args): | |
217 | + """ | |
218 | + __eq__(self, x) -> bool | |
219 | + Parameters: | |
220 | + self: swig::SwigPyIterator const * value | |
221 | + x: swig::SwigPyIterator const & value | |
222 | + | |
223 | + x: swig::SwigPyIterator const & value | |
224 | + | |
225 | + """ | |
226 | + return _morfeusz.SwigPyIterator___eq__(self, *args) | |
227 | + | |
228 | + def __ne__(self, *args): | |
229 | + """ | |
230 | + __ne__(self, x) -> bool | |
231 | + Parameters: | |
232 | + self: swig::SwigPyIterator const * value | |
233 | + x: swig::SwigPyIterator const & value | |
234 | + | |
235 | + x: swig::SwigPyIterator const & value | |
236 | + | |
237 | + """ | |
238 | + return _morfeusz.SwigPyIterator___ne__(self, *args) | |
239 | + | |
240 | + def __iadd__(self, *args): | |
241 | + """ | |
242 | + __iadd__(self, n) -> SwigPyIterator | |
243 | + Parameters: | |
244 | + self: swig::SwigPyIterator * value | |
245 | + n: ptrdiff_t value | |
246 | + | |
247 | + n: ptrdiff_t value | |
248 | + | |
249 | + """ | |
250 | + return _morfeusz.SwigPyIterator___iadd__(self, *args) | |
251 | + | |
252 | + def __isub__(self, *args): | |
253 | + """ | |
254 | + __isub__(self, n) -> SwigPyIterator | |
255 | + Parameters: | |
256 | + self: swig::SwigPyIterator * value | |
257 | + n: ptrdiff_t value | |
258 | + | |
259 | + n: ptrdiff_t value | |
260 | + | |
261 | + """ | |
262 | + return _morfeusz.SwigPyIterator___isub__(self, *args) | |
263 | + | |
264 | + def __add__(self, *args): | |
265 | + """ | |
266 | + __add__(self, n) -> SwigPyIterator | |
267 | + Parameters: | |
268 | + self: swig::SwigPyIterator const * value | |
269 | + n: ptrdiff_t value | |
270 | + | |
271 | + n: ptrdiff_t value | |
272 | + | |
273 | + """ | |
274 | + return _morfeusz.SwigPyIterator___add__(self, *args) | |
275 | + | |
276 | + def __sub__(self, *args): | |
277 | + """ | |
278 | + __sub__(self, n) -> SwigPyIterator | |
279 | + Parameters: | |
280 | + n: ptrdiff_t value | |
281 | + | |
282 | + n: ptrdiff_t value | |
283 | + | |
284 | + __sub__(self, x) -> ptrdiff_t | |
285 | + Parameters: | |
286 | + self: swig::SwigPyIterator const * value | |
287 | + x: swig::SwigPyIterator const & value | |
288 | + | |
289 | + x: swig::SwigPyIterator const & value | |
290 | + | |
291 | + """ | |
292 | + return _morfeusz.SwigPyIterator___sub__(self, *args) | |
293 | + | |
294 | + def __iter__(self): return self | |
295 | +SwigPyIterator_swigregister = _morfeusz.SwigPyIterator_swigregister | |
296 | +SwigPyIterator_swigregister(SwigPyIterator) | |
297 | + | |
298 | +class MorfeuszException(_object): | |
299 | + """Proxy of C++ MorfeuszException class""" | |
300 | + __swig_setmethods__ = {} | |
301 | + __setattr__ = lambda self, name, value: _swig_setattr(self, MorfeuszException, name, value) | |
302 | + __swig_getmethods__ = {} | |
303 | + __getattr__ = lambda self, name: _swig_getattr(self, MorfeuszException, name) | |
304 | + __repr__ = _swig_repr | |
305 | + def __init__(self, *args): | |
306 | + """ | |
307 | + __init__(self, what) -> MorfeuszException | |
308 | + Parameters: | |
309 | + what: std::string const & value | |
310 | + | |
311 | + what: std::string const & value | |
312 | + | |
313 | + """ | |
314 | + this = _morfeusz.new_MorfeuszException(*args) | |
315 | + try: self.this.append(this) | |
316 | + except: self.this = this | |
317 | + __swig_destroy__ = _morfeusz.delete_MorfeuszException | |
318 | + __del__ = lambda self : None; | |
319 | + def what(self): | |
320 | + """ | |
321 | + what(self) -> char | |
322 | + Parameters: | |
323 | + self: MorfeuszException const * value | |
324 | + | |
325 | + | |
326 | + | |
327 | + | |
328 | + """ | |
329 | + return _morfeusz.MorfeuszException_what(self) | |
330 | + | |
331 | +MorfeuszException_swigregister = _morfeusz.MorfeuszException_swigregister | |
332 | +MorfeuszException_swigregister(MorfeuszException) | |
333 | + | |
334 | +class Morfeusz(_object): | |
335 | + """Proxy of C++ Morfeusz class""" | |
336 | + __swig_setmethods__ = {} | |
337 | + __setattr__ = lambda self, name, value: _swig_setattr(self, Morfeusz, name, value) | |
338 | + __swig_getmethods__ = {} | |
339 | + __getattr__ = lambda self, name: _swig_getattr(self, Morfeusz, name) | |
340 | + __repr__ = _swig_repr | |
341 | + def __init__(self, *args): | |
342 | + """ | |
343 | + __init__(self) -> Morfeusz | |
344 | + __init__(self, filename) -> Morfeusz | |
345 | + Parameters: | |
346 | + filename: std::string const & value | |
347 | + | |
348 | + filename: std::string const & value | |
349 | + | |
350 | + """ | |
351 | + this = _morfeusz.new_Morfeusz(*args) | |
352 | + try: self.this.append(this) | |
353 | + except: self.this = this | |
354 | + __swig_destroy__ = _morfeusz.delete_Morfeusz | |
355 | + __del__ = lambda self : None; | |
356 | + def analyze(self, *args): | |
357 | + """ | |
358 | + analyze(self, text) -> ResultsIterator | |
359 | + Parameters: | |
360 | + text: std::string const & value | |
361 | + | |
362 | + text: std::string const & value | |
363 | + | |
364 | + analyze(self, text, result) | |
365 | + Parameters: | |
366 | + self: Morfeusz const * value | |
367 | + text: std::string const & value | |
368 | + result: std::vector< MorphInterpretation,std::allocator< MorphInterpretation > > & value | |
369 | + | |
370 | + text: std::string const & value | |
371 | + result: std::vector< MorphInterpretation,std::allocator< MorphInterpretation > > & value | |
372 | + | |
373 | + """ | |
374 | + return _morfeusz.Morfeusz_analyze(self, *args) | |
375 | + | |
376 | + def setEncoding(self, *args): | |
377 | + """ | |
378 | + setEncoding(self, encoding) | |
379 | + Parameters: | |
380 | + self: Morfeusz * value | |
381 | + encoding: enum MorfeuszCharset value | |
382 | + | |
383 | + encoding: enum MorfeuszCharset value | |
384 | + | |
385 | + """ | |
386 | + return _morfeusz.Morfeusz_setEncoding(self, *args) | |
387 | + | |
388 | +Morfeusz_swigregister = _morfeusz.Morfeusz_swigregister | |
389 | +Morfeusz_swigregister(Morfeusz) | |
390 | + | |
391 | +class ResultsIterator(_object): | |
392 | + """Proxy of C++ ResultsIterator class""" | |
393 | + __swig_setmethods__ = {} | |
394 | + __setattr__ = lambda self, name, value: _swig_setattr(self, ResultsIterator, name, value) | |
395 | + __swig_getmethods__ = {} | |
396 | + __getattr__ = lambda self, name: _swig_getattr(self, ResultsIterator, name) | |
397 | + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") | |
398 | + __repr__ = _swig_repr | |
399 | + def getNext(self): | |
400 | + """ | |
401 | + getNext(self) -> MorphInterpretation | |
402 | + Parameters: | |
403 | + self: ResultsIterator * value | |
404 | + | |
405 | + | |
406 | + | |
407 | + | |
408 | + """ | |
409 | + return _morfeusz.ResultsIterator_getNext(self) | |
410 | + | |
411 | + def hasNext(self): | |
412 | + """ | |
413 | + hasNext(self) -> bool | |
414 | + Parameters: | |
415 | + self: ResultsIterator * value | |
416 | + | |
417 | + | |
418 | + | |
419 | + | |
420 | + """ | |
421 | + return _morfeusz.ResultsIterator_hasNext(self) | |
422 | + | |
423 | + __swig_destroy__ = _morfeusz.delete_ResultsIterator | |
424 | + __del__ = lambda self : None; | |
425 | +ResultsIterator_swigregister = _morfeusz.ResultsIterator_swigregister | |
426 | +ResultsIterator_swigregister(ResultsIterator) | |
427 | + | |
428 | +class MorphInterpretation(_object): | |
429 | + """Proxy of C++ MorphInterpretation class""" | |
430 | + __swig_setmethods__ = {} | |
431 | + __setattr__ = lambda self, name, value: _swig_setattr(self, MorphInterpretation, name, value) | |
432 | + __swig_getmethods__ = {} | |
433 | + __getattr__ = lambda self, name: _swig_getattr(self, MorphInterpretation, name) | |
434 | + def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") | |
435 | + __repr__ = _swig_repr | |
436 | + def getStartNode(self): | |
437 | + """ | |
438 | + getStartNode(self) -> int | |
439 | + Parameters: | |
440 | + self: MorphInterpretation const * value | |
441 | + | |
442 | + | |
443 | + | |
444 | + | |
445 | + """ | |
446 | + return _morfeusz.MorphInterpretation_getStartNode(self) | |
447 | + | |
448 | + def getEndNode(self): | |
449 | + """ | |
450 | + getEndNode(self) -> int | |
451 | + Parameters: | |
452 | + self: MorphInterpretation const * value | |
453 | + | |
454 | + | |
455 | + | |
456 | + | |
457 | + """ | |
458 | + return _morfeusz.MorphInterpretation_getEndNode(self) | |
459 | + | |
460 | + def getOrth(self): | |
461 | + """ | |
462 | + getOrth(self) -> string | |
463 | + Parameters: | |
464 | + self: MorphInterpretation const * value | |
465 | + | |
466 | + | |
467 | + | |
468 | + | |
469 | + """ | |
470 | + return _morfeusz.MorphInterpretation_getOrth(self) | |
471 | + | |
472 | + def getLemma(self): | |
473 | + """ | |
474 | + getLemma(self) -> string | |
475 | + Parameters: | |
476 | + self: MorphInterpretation const * value | |
477 | + | |
478 | + | |
479 | + | |
480 | + | |
481 | + """ | |
482 | + return _morfeusz.MorphInterpretation_getLemma(self) | |
483 | + | |
484 | + def getTagnum(self): | |
485 | + """ | |
486 | + getTagnum(self) -> int | |
487 | + Parameters: | |
488 | + self: MorphInterpretation const * value | |
489 | + | |
490 | + | |
491 | + | |
492 | + | |
493 | + """ | |
494 | + return _morfeusz.MorphInterpretation_getTagnum(self) | |
495 | + | |
496 | + def getNamenum(self): | |
497 | + """ | |
498 | + getNamenum(self) -> int | |
499 | + Parameters: | |
500 | + self: MorphInterpretation const * value | |
501 | + | |
502 | + | |
503 | + | |
504 | + | |
505 | + """ | |
506 | + return _morfeusz.MorphInterpretation_getNamenum(self) | |
507 | + | |
508 | + def getTag(self): | |
509 | + """ | |
510 | + getTag(self) -> string | |
511 | + Parameters: | |
512 | + self: MorphInterpretation const * value | |
513 | + | |
514 | + | |
515 | + | |
516 | + | |
517 | + """ | |
518 | + return _morfeusz.MorphInterpretation_getTag(self) | |
519 | + | |
520 | + def getName(self): | |
521 | + """ | |
522 | + getName(self) -> string | |
523 | + Parameters: | |
524 | + self: MorphInterpretation const * value | |
525 | + | |
526 | + | |
527 | + | |
528 | + | |
529 | + """ | |
530 | + return _morfeusz.MorphInterpretation_getName(self) | |
531 | + | |
532 | + __swig_destroy__ = _morfeusz.delete_MorphInterpretation | |
533 | + __del__ = lambda self : None; | |
534 | +MorphInterpretation_swigregister = _morfeusz.MorphInterpretation_swigregister | |
535 | +MorphInterpretation_swigregister(MorphInterpretation) | |
536 | + | |
537 | +UTF8 = _morfeusz.UTF8 | |
538 | +ISO8859_2 = _morfeusz.ISO8859_2 | |
539 | +CP1250 = _morfeusz.CP1250 | |
540 | +CP852 = _morfeusz.CP852 | |
541 | +class InterpsVector(_object): | |
542 | + """Proxy of C++ std::vector<(MorphInterpretation)> class""" | |
543 | + __swig_setmethods__ = {} | |
544 | + __setattr__ = lambda self, name, value: _swig_setattr(self, InterpsVector, name, value) | |
545 | + __swig_getmethods__ = {} | |
546 | + __getattr__ = lambda self, name: _swig_getattr(self, InterpsVector, name) | |
547 | + __repr__ = _swig_repr | |
548 | + def iterator(self): | |
549 | + """ | |
550 | + iterator(self) -> SwigPyIterator | |
551 | + Parameters: | |
552 | + self: std::vector< MorphInterpretation > * value | |
553 | + | |
554 | + | |
555 | + | |
556 | + | |
557 | + """ | |
558 | + return _morfeusz.InterpsVector_iterator(self) | |
559 | + | |
560 | + def __iter__(self): return self.iterator() | |
561 | + def __nonzero__(self): | |
562 | + """ | |
563 | + __nonzero__(self) -> bool | |
564 | + Parameters: | |
565 | + self: std::vector< MorphInterpretation > const * value | |
566 | + | |
567 | + | |
568 | + | |
569 | + | |
570 | + """ | |
571 | + return _morfeusz.InterpsVector___nonzero__(self) | |
572 | + | |
573 | + def __bool__(self): | |
574 | + """ | |
575 | + __bool__(self) -> bool | |
576 | + Parameters: | |
577 | + self: std::vector< MorphInterpretation > const * value | |
578 | + | |
579 | + | |
580 | + | |
581 | + | |
582 | + """ | |
583 | + return _morfeusz.InterpsVector___bool__(self) | |
584 | + | |
585 | + def __len__(self): | |
586 | + """ | |
587 | + __len__(self) -> size_type | |
588 | + Parameters: | |
589 | + self: std::vector< MorphInterpretation > const * value | |
590 | + | |
591 | + | |
592 | + | |
593 | + | |
594 | + """ | |
595 | + return _morfeusz.InterpsVector___len__(self) | |
596 | + | |
597 | + def pop(self): | |
598 | + """ | |
599 | + pop(self) -> value_type | |
600 | + Parameters: | |
601 | + self: std::vector< MorphInterpretation > * value | |
602 | + | |
603 | + | |
604 | + | |
605 | + | |
606 | + """ | |
607 | + return _morfeusz.InterpsVector_pop(self) | |
608 | + | |
609 | + def __getslice__(self, *args): | |
610 | + """ | |
611 | + __getslice__(self, i, j) -> InterpsVector | |
612 | + Parameters: | |
613 | + self: std::vector< MorphInterpretation > * value | |
614 | + i: std::vector< MorphInterpretation >::difference_type value | |
615 | + j: std::vector< MorphInterpretation >::difference_type value | |
616 | + | |
617 | + i: std::vector< MorphInterpretation >::difference_type value | |
618 | + j: std::vector< MorphInterpretation >::difference_type value | |
619 | + | |
620 | + """ | |
621 | + return _morfeusz.InterpsVector___getslice__(self, *args) | |
622 | + | |
623 | + def __setslice__(self, *args): | |
624 | + """ | |
625 | + __setslice__(self, i, j, v = std::vector< MorphInterpretation,std::allocator< MorphInterpretation > >()) | |
626 | + Parameters: | |
627 | + i: std::vector< MorphInterpretation >::difference_type value | |
628 | + j: std::vector< MorphInterpretation >::difference_type value | |
629 | + v: std::vector< MorphInterpretation,std::allocator< MorphInterpretation > > const & value | |
630 | + | |
631 | + i: std::vector< MorphInterpretation >::difference_type value | |
632 | + j: std::vector< MorphInterpretation >::difference_type value | |
633 | + v: std::vector< MorphInterpretation,std::allocator< MorphInterpretation > > const & value | |
634 | + | |
635 | + __setslice__(self, i, j) | |
636 | + Parameters: | |
637 | + self: std::vector< MorphInterpretation > * value | |
638 | + i: std::vector< MorphInterpretation >::difference_type value | |
639 | + j: std::vector< MorphInterpretation >::difference_type value | |
640 | + | |
641 | + i: std::vector< MorphInterpretation >::difference_type value | |
642 | + j: std::vector< MorphInterpretation >::difference_type value | |
643 | + | |
644 | + """ | |
645 | + return _morfeusz.InterpsVector___setslice__(self, *args) | |
646 | + | |
647 | + def __delslice__(self, *args): | |
648 | + """ | |
649 | + __delslice__(self, i, j) | |
650 | + Parameters: | |
651 | + self: std::vector< MorphInterpretation > * value | |
652 | + i: std::vector< MorphInterpretation >::difference_type value | |
653 | + j: std::vector< MorphInterpretation >::difference_type value | |
654 | + | |
655 | + i: std::vector< MorphInterpretation >::difference_type value | |
656 | + j: std::vector< MorphInterpretation >::difference_type value | |
657 | + | |
658 | + """ | |
659 | + return _morfeusz.InterpsVector___delslice__(self, *args) | |
660 | + | |
661 | + def __delitem__(self, *args): | |
662 | + """ | |
663 | + __delitem__(self, i) | |
664 | + Parameters: | |
665 | + i: std::vector< MorphInterpretation >::difference_type value | |
666 | + | |
667 | + i: std::vector< MorphInterpretation >::difference_type value | |
668 | + | |
669 | + __delitem__(self, slice) | |
670 | + Parameters: | |
671 | + self: std::vector< MorphInterpretation > * value | |
672 | + slice: PySliceObject * value | |
673 | + | |
674 | + slice: PySliceObject * value | |
675 | + | |
676 | + """ | |
677 | + return _morfeusz.InterpsVector___delitem__(self, *args) | |
678 | + | |
679 | + def __getitem__(self, *args): | |
680 | + """ | |
681 | + __getitem__(self, slice) -> InterpsVector | |
682 | + Parameters: | |
683 | + slice: PySliceObject * value | |
684 | + | |
685 | + slice: PySliceObject * value | |
686 | + | |
687 | + __getitem__(self, i) -> value_type | |
688 | + Parameters: | |
689 | + self: std::vector< MorphInterpretation > const * value | |
690 | + i: std::vector< MorphInterpretation >::difference_type value | |
691 | + | |
692 | + i: std::vector< MorphInterpretation >::difference_type value | |
693 | + | |
694 | + """ | |
695 | + return _morfeusz.InterpsVector___getitem__(self, *args) | |
696 | + | |
697 | + def __setitem__(self, *args): | |
698 | + """ | |
699 | + __setitem__(self, slice, v) | |
700 | + Parameters: | |
701 | + slice: PySliceObject * value | |
702 | + v: std::vector< MorphInterpretation,std::allocator< MorphInterpretation > > const & value | |
703 | + | |
704 | + slice: PySliceObject * value | |
705 | + v: std::vector< MorphInterpretation,std::allocator< MorphInterpretation > > const & value | |
706 | + | |
707 | + __setitem__(self, slice) | |
708 | + Parameters: | |
709 | + slice: PySliceObject * value | |
710 | + | |
711 | + slice: PySliceObject * value | |
712 | + | |
713 | + __setitem__(self, i, x) | |
714 | + Parameters: | |
715 | + self: std::vector< MorphInterpretation > * value | |
716 | + i: std::vector< MorphInterpretation >::difference_type value | |
717 | + x: std::vector< MorphInterpretation >::value_type const & value | |
718 | + | |
719 | + i: std::vector< MorphInterpretation >::difference_type value | |
720 | + x: std::vector< MorphInterpretation >::value_type const & value | |
721 | + | |
722 | + """ | |
723 | + return _morfeusz.InterpsVector___setitem__(self, *args) | |
724 | + | |
725 | + def append(self, *args): | |
726 | + """ | |
727 | + append(self, x) | |
728 | + Parameters: | |
729 | + self: std::vector< MorphInterpretation > * value | |
730 | + x: std::vector< MorphInterpretation >::value_type const & value | |
731 | + | |
732 | + x: std::vector< MorphInterpretation >::value_type const & value | |
733 | + | |
734 | + """ | |
735 | + return _morfeusz.InterpsVector_append(self, *args) | |
736 | + | |
737 | + def empty(self): | |
738 | + """ | |
739 | + empty(self) -> bool | |
740 | + Parameters: | |
741 | + self: std::vector< MorphInterpretation > const * value | |
742 | + | |
743 | + | |
744 | + | |
745 | + | |
746 | + """ | |
747 | + return _morfeusz.InterpsVector_empty(self) | |
748 | + | |
749 | + def size(self): | |
750 | + """ | |
751 | + size(self) -> size_type | |
752 | + Parameters: | |
753 | + self: std::vector< MorphInterpretation > const * value | |
754 | + | |
755 | + | |
756 | + | |
757 | + | |
758 | + """ | |
759 | + return _morfeusz.InterpsVector_size(self) | |
760 | + | |
761 | + def clear(self): | |
762 | + """ | |
763 | + clear(self) | |
764 | + Parameters: | |
765 | + self: std::vector< MorphInterpretation > * value | |
766 | + | |
767 | + | |
768 | + | |
769 | + | |
770 | + """ | |
771 | + return _morfeusz.InterpsVector_clear(self) | |
772 | + | |
773 | + def swap(self, *args): | |
774 | + """ | |
775 | + swap(self, v) | |
776 | + Parameters: | |
777 | + self: std::vector< MorphInterpretation > * value | |
778 | + v: std::vector< MorphInterpretation > & value | |
779 | + | |
780 | + v: std::vector< MorphInterpretation > & value | |
781 | + | |
782 | + """ | |
783 | + return _morfeusz.InterpsVector_swap(self, *args) | |
784 | + | |
785 | + def get_allocator(self): | |
786 | + """ | |
787 | + get_allocator(self) -> allocator_type | |
788 | + Parameters: | |
789 | + self: std::vector< MorphInterpretation > const * value | |
790 | + | |
791 | + | |
792 | + | |
793 | + | |
794 | + """ | |
795 | + return _morfeusz.InterpsVector_get_allocator(self) | |
796 | + | |
797 | + def begin(self): | |
798 | + """ | |
799 | + begin(self) -> iterator | |
800 | + Parameters: | |
801 | + self: std::vector< MorphInterpretation > * value | |
802 | + | |
803 | + | |
804 | + | |
805 | + | |
806 | + """ | |
807 | + return _morfeusz.InterpsVector_begin(self) | |
808 | + | |
809 | + def end(self): | |
810 | + """ | |
811 | + end(self) -> iterator | |
812 | + Parameters: | |
813 | + self: std::vector< MorphInterpretation > * value | |
814 | + | |
815 | + | |
816 | + | |
817 | + | |
818 | + """ | |
819 | + return _morfeusz.InterpsVector_end(self) | |
820 | + | |
821 | + def rbegin(self): | |
822 | + """ | |
823 | + rbegin(self) -> reverse_iterator | |
824 | + Parameters: | |
825 | + self: std::vector< MorphInterpretation > * value | |
826 | + | |
827 | + | |
828 | + | |
829 | + | |
830 | + """ | |
831 | + return _morfeusz.InterpsVector_rbegin(self) | |
832 | + | |
833 | + def rend(self): | |
834 | + """ | |
835 | + rend(self) -> reverse_iterator | |
836 | + Parameters: | |
837 | + self: std::vector< MorphInterpretation > * value | |
838 | + | |
839 | + | |
840 | + | |
841 | + | |
842 | + """ | |
843 | + return _morfeusz.InterpsVector_rend(self) | |
844 | + | |
845 | + def pop_back(self): | |
846 | + """ | |
847 | + pop_back(self) | |
848 | + Parameters: | |
849 | + self: std::vector< MorphInterpretation > * value | |
850 | + | |
851 | + | |
852 | + | |
853 | + | |
854 | + """ | |
855 | + return _morfeusz.InterpsVector_pop_back(self) | |
856 | + | |
857 | + def erase(self, *args): | |
858 | + """ | |
859 | + erase(self, pos) -> iterator | |
860 | + Parameters: | |
861 | + pos: std::vector< MorphInterpretation >::iterator value | |
862 | + | |
863 | + pos: std::vector< MorphInterpretation >::iterator value | |
864 | + | |
865 | + erase(self, first, last) -> iterator | |
866 | + Parameters: | |
867 | + self: std::vector< MorphInterpretation > * value | |
868 | + first: std::vector< MorphInterpretation >::iterator value | |
869 | + last: std::vector< MorphInterpretation >::iterator value | |
870 | + | |
871 | + first: std::vector< MorphInterpretation >::iterator value | |
872 | + last: std::vector< MorphInterpretation >::iterator value | |
873 | + | |
874 | + """ | |
875 | + return _morfeusz.InterpsVector_erase(self, *args) | |
876 | + | |
877 | + def __init__(self, *args): | |
878 | + """ | |
879 | + __init__(self) -> InterpsVector | |
880 | + __init__(self, arg0) -> InterpsVector | |
881 | + Parameters: | |
882 | + : std::vector< MorphInterpretation > const & value | |
883 | + | |
884 | + : std::vector< MorphInterpretation > const & value | |
885 | + | |
886 | + __init__(self, size, value) -> InterpsVector | |
887 | + Parameters: | |
888 | + size: std::vector< MorphInterpretation >::size_type value | |
889 | + value: std::vector< MorphInterpretation >::value_type const & value | |
890 | + | |
891 | + size: std::vector< MorphInterpretation >::size_type value | |
892 | + value: std::vector< MorphInterpretation >::value_type const & value | |
893 | + | |
894 | + """ | |
895 | + this = _morfeusz.new_InterpsVector(*args) | |
896 | + try: self.this.append(this) | |
897 | + except: self.this = this | |
898 | + def push_back(self, *args): | |
899 | + """ | |
900 | + push_back(self, x) | |
901 | + Parameters: | |
902 | + self: std::vector< MorphInterpretation > * value | |
903 | + x: std::vector< MorphInterpretation >::value_type const & value | |
904 | + | |
905 | + x: std::vector< MorphInterpretation >::value_type const & value | |
906 | + | |
907 | + """ | |
908 | + return _morfeusz.InterpsVector_push_back(self, *args) | |
909 | + | |
910 | + def front(self): | |
911 | + """ | |
912 | + front(self) -> value_type | |
913 | + Parameters: | |
914 | + self: std::vector< MorphInterpretation > const * value | |
915 | + | |
916 | + | |
917 | + | |
918 | + | |
919 | + """ | |
920 | + return _morfeusz.InterpsVector_front(self) | |
921 | + | |
922 | + def back(self): | |
923 | + """ | |
924 | + back(self) -> value_type | |
925 | + Parameters: | |
926 | + self: std::vector< MorphInterpretation > const * value | |
927 | + | |
928 | + | |
929 | + | |
930 | + | |
931 | + """ | |
932 | + return _morfeusz.InterpsVector_back(self) | |
933 | + | |
934 | + def assign(self, *args): | |
935 | + """ | |
936 | + assign(self, n, x) | |
937 | + Parameters: | |
938 | + self: std::vector< MorphInterpretation > * value | |
939 | + n: std::vector< MorphInterpretation >::size_type value | |
940 | + x: std::vector< MorphInterpretation >::value_type const & value | |
941 | + | |
942 | + n: std::vector< MorphInterpretation >::size_type value | |
943 | + x: std::vector< MorphInterpretation >::value_type const & value | |
944 | + | |
945 | + """ | |
946 | + return _morfeusz.InterpsVector_assign(self, *args) | |
947 | + | |
948 | + def insert(self, *args): | |
949 | + """ | |
950 | + insert(self, pos, x) -> iterator | |
951 | + Parameters: | |
952 | + pos: std::vector< MorphInterpretation >::iterator value | |
953 | + x: std::vector< MorphInterpretation >::value_type const & value | |
954 | + | |
955 | + pos: std::vector< MorphInterpretation >::iterator value | |
956 | + x: std::vector< MorphInterpretation >::value_type const & value | |
957 | + | |
958 | + insert(self, pos, n, x) | |
959 | + Parameters: | |
960 | + self: std::vector< MorphInterpretation > * value | |
961 | + pos: std::vector< MorphInterpretation >::iterator value | |
962 | + n: std::vector< MorphInterpretation >::size_type value | |
963 | + x: std::vector< MorphInterpretation >::value_type const & value | |
964 | + | |
965 | + pos: std::vector< MorphInterpretation >::iterator value | |
966 | + n: std::vector< MorphInterpretation >::size_type value | |
967 | + x: std::vector< MorphInterpretation >::value_type const & value | |
968 | + | |
969 | + """ | |
970 | + return _morfeusz.InterpsVector_insert(self, *args) | |
971 | + | |
972 | + def reserve(self, *args): | |
973 | + """ | |
974 | + reserve(self, n) | |
975 | + Parameters: | |
976 | + self: std::vector< MorphInterpretation > * value | |
977 | + n: std::vector< MorphInterpretation >::size_type value | |
978 | + | |
979 | + n: std::vector< MorphInterpretation >::size_type value | |
980 | + | |
981 | + """ | |
982 | + return _morfeusz.InterpsVector_reserve(self, *args) | |
983 | + | |
984 | + def capacity(self): | |
985 | + """ | |
986 | + capacity(self) -> size_type | |
987 | + Parameters: | |
988 | + self: std::vector< MorphInterpretation > const * value | |
989 | + | |
990 | + | |
991 | + | |
992 | + | |
993 | + """ | |
994 | + return _morfeusz.InterpsVector_capacity(self) | |
995 | + | |
996 | + __swig_destroy__ = _morfeusz.delete_InterpsVector | |
997 | + __del__ = lambda self : None; | |
998 | +InterpsVector_swigregister = _morfeusz.InterpsVector_swigregister | |
999 | +InterpsVector_swigregister(InterpsVector) | |
1000 | +cvar = _morfeusz.cvar | |
1001 | +DEFAULT_MORFEUSZ_CHARSET = cvar.DEFAULT_MORFEUSZ_CHARSET | |
1002 | + | |
1003 | +def analyze(self, text): | |
1004 | + res = InterpsVector() | |
1005 | + _morfeusz.Morfeusz_analyze(self, text, res) | |
1006 | + return list(res) | |
1007 | + | |
1008 | +Morfeusz.analyze = analyze | |
1009 | + | |
1010 | +def getOrth(self): | |
1011 | + return _morfeusz.MorphInterpretation_getOrth(self).decode('utf8') | |
1012 | + | |
1013 | +def getLemma(self): | |
1014 | + return _morfeusz.MorphInterpretation_getLemma(self).decode('utf8') | |
1015 | + | |
1016 | +def getTag(self): | |
1017 | + return _morfeusz.MorphInterpretation_getTag(self).decode('utf8') | |
1018 | + | |
1019 | +def getName(self): | |
1020 | + return _morfeusz.MorphInterpretation_getName(self).decode('utf8') | |
1021 | + | |
1022 | +MorphInterpretation.getOrth = getOrth | |
1023 | +MorphInterpretation.getLemma = getLemma | |
1024 | +MorphInterpretation.getTag = getTag | |
1025 | +MorphInterpretation.getName = getName | |
1026 | + | |
1027 | +# This file is compatible with both classic and new-style classes. | |
1028 | + | |
1029 | + | |
... | ... |