Skip to content

Commit

Permalink
Merge pull request HIT-SCIR#33 from HIT-SCIR/develop
Browse files Browse the repository at this point in the history
Add maven to build and update ltp to 3.4.0
  • Loading branch information
liu946 authored Dec 24, 2017
2 parents b631187 + 8dd4efe commit 28f08b3
Show file tree
Hide file tree
Showing 55 changed files with 1,846 additions and 520 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

###########
# data #
###########
ltp_data

###########
# outputs #
###########
output
CMakeFiles
cmake_install.cmake
CmakeCache.txt
Makefile
libs
target

###########
# IDEs #
###########
.idea
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "ltp"]
path = ltp
[submodule "src/main/c++/ltp"]
path = src/main/c++/ltp
url = https://github.com/HIT-SCIR/ltp.git
18 changes: 4 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@ os:
- linux
- osx

before_install:
- sudo apt-get install cmake
before_script:
- if [[ "$TRAVIS_OS_NAME" == "osx" && -z "$JAVA_HOME" && -x "/usr/libexec/java_home" ]] ; then export JAVA_HOME=$(/usr/libexec/java_home); fi
- git submodule init
- git submodule update
- cd ltp
- ./configure
- make
- cd ..

install:
- cmake -DLTP_HOME=`pwd`/ltp/ .
- make
- ant
- export LD_LIBRARY_PATH=LD_LIBRARY_PATH:`pwd`/libs/:`pwd`/ltp/lib

script:
- javac -cp "output/jar/ltp4j.jar" examples/Test.java
- cat examples/example | java -cp "output/jar/ltp4j.jar:examples" Test --segment-model=ltp_data/cws.model --postag-model=ltp_data/pos.model --ner-model=ltp_data/ner.model --parser-model=ltp_data/parser.model --srl-dir=ltp_data/srl/
- mvn -Dmaven.test.skip=true
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8.0)
project ("ltp4j")

find_package(JNI)
set (LTP_HOME "/path/to/your/ltp/" CACHE STRING "Use to specified ltp path")
set (LTP_HOME "${PROJECT_SOURCE_DIR}/ltp" CACHE STRING "Use to specified ltp path") # change it to your ltp root
set (LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/libs)
set (JNI_SOURCE_DIR ${PROJECT_SOURCE_DIR}/jni)

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ ltp4j<sup>beta</sup>: Language Technology Platform For Java
============================================

[![Build Status](https://travis-ci.org/HIT-SCIR/ltp4j.svg?branch=integrate-test)](https://travis-ci.org/HIT-SCIR/ltp4j)
[![Documentation Status](https://readthedocs.org/projects/ltp/badge/?version=latest)](http://ltp4j.readthedocs.org/en/neoltp4j/?badge=neoltp4j)

# 更新

1. ltp4j 现已经更新对 LTP 3.4.0的支持。
2. 项目改用 maven 构建、编译。具体使用方法参见文档。

# 简介

Expand All @@ -11,5 +17,5 @@ ltp4j是语言技术平台[(Language Technology Platform, LTP)](https://github.c

# 文档

关于ltp4j的使用,请参考[ltp4j使用文档v1.0](https://github.com/HIT-SCIR/ltp4j/blob/master/doc/ltp4j-document-1.0.md)
请参考在线文档:[ltp4j使用文档](http://ltp4j.readthedocs.io)

3 changes: 3 additions & 0 deletions aol.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
amd64.Windows.msvc.cpp.defines=Windows WIN32 _WINDOWS NOMINMAX BOOST_ALL_NO_LIB
amd64.Windows.msvc.c.defines=Windows WIN32 _WINDOWS NOMINMAX BOOST_ALL_NO_LIB

30 changes: 30 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '{build}'

image:
- Visual Studio 2015
- Visual Studio 2017

platform: x64

install:
- ps: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven" )) {
(new-object System.Net.WebClient).DownloadFile(
'http://www.us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip',
'C:\maven-bin.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
}
- cmd: SET PATH=C:\maven\apache-maven-3.3.9\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g

build_script:
- git submodule init
- git submodule update
- mvn -Dmaven.test.skip=true

cache:
- C:\maven\
- C:\Users\appveyor\.m2
27 changes: 0 additions & 27 deletions build.xml

This file was deleted.

Binary file removed doc/BaseDirectory.png
Binary file not shown.
Binary file added doc/_static/eclipse.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 28f08b3

Please sign in to comment.