source: trunk/dports/textproc/jdepp/Portfile

Last change on this file was 135283, checked in by hum@…, 2 years ago

jdepp: fix kyoto variant; see #47524

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 135283 2015-04-22 11:13:53Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                jdepp
7version             2015-02-08
8categories          textproc japanese
9maintainers         hum openmaintainer
10
11description         C++ implementation of Japanese Dependency Parsers
12
13long_description    J.DepP is a C++ implementation of Japanese dependency \
14                    parsing algorithms. The parser takes a raw sentence as input \
15                    and performs word segmentation, POS tagging (thanks to MeCab), \
16                    bunsetsu chunking and dependency parsing. J.DepP is meant \
17                    for those who want to parse massive texts (e.g., entire blog \
18                    feeds) efficiently with state-of-the-art parsing accuracy.
19
20homepage            http://www.tkl.iis.u-tokyo.ac.jp/~ynaga/jdepp/
21platforms           darwin
22license             {GPL-2 LGPL-2.1}
23
24master_sites        ${homepage}
25checksums           ${distname}${extract.suffix} \
26                    rmd160  845584ae822b4ddb0bb439765be7714a97be0ed8 \
27                    sha256  55a1a99b6645c4e01126f931fd72bf308dde96df8319f09e1c7cb9cd1ffdae7f
28
29depends_lib         port:mecab-base \
30                    port:mecab-jumandic-utf8
31
32patchfiles          patch-configure.diff
33
34post-patch {
35    reinplace "s|KNBC_CORPUS_DIR=\${PWD}/KNBC_v1.0_090925|KNBC_CORPUS_DIR=${prefix}/share/KNBC|" \
36        ${worksrcpath}/configure
37}
38
39configure.args      --enable-standalone
40
41variant knbc conflicts kyoto kyoto_partial description {Train a parser wht KNBC (Kyoto-University and NTT Blog Corpus)} {
42    depends_build-append  port:KNBC
43
44    configure.args-append --with-corpus=knbc
45
46    build.target          model
47    build.args-append     CORPUS_DIR=${prefix}/share/KNBC
48}
49
50variant kyoto_partial conflicts kyoto knbc description {Train a parser with Kyoto-University Text Corpus annotation without Mainichi news articles} {
51    set kyoto_corpus      KyotoCorpus4.0
52    set corpus_distfile   ${kyoto_corpus}${extract.suffix}
53    distfiles-append      ${corpus_distfile}:corpus
54    master_sites-append   http://nlp.ist.i.kyoto-u.ac.jp/nl-resource/corpus/:corpus
55    checksums-append      ${corpus_distfile} \
56                          rmd160  9c8212d939b7112a79aff30ab0880f94c3ee9b48 \
57                          sha256  6fe4f7bac19e192f7545c4de0c765f690a524c7611191e2af9be031d4923871f
58
59    configure.args-append --with-corpus=kyoto-partial \
60                          --enable-autopos-train=no
61
62    build.target          model
63    build.args-append     CORPUS_DIR=${workpath}/${kyoto_corpus}
64}
65
66# To use the complete kyoto corpus with +kyoto variant, users must put their data into the following directory.
67set kyoto_dir       /tmp/KyotoCorpus4.0
68
69variant kyoto conflicts kyoto_partial knbc description {Train a parser with Kyoto-University Text Corpus} {
70    if {[file exists ${kyoto_dir}]} {
71        configure.args-append --with-corpus=kyoto
72        build.target          model
73        build.args-append     CORPUS_DIR=${kyoto_dir}
74    } else {
75        pre-fetch {
76            ui_error "To train a parser with Kyoto Corpus, please put the files in ${kyoto_dir}"
77            return -code error "Kyoto Corpus is not available at ${kyoto_dir}"
78        }
79    }
80}
81
82variant ipadic conflicts naistjdic unidic description {Build a parser with auto POSs given by MeCab/ipadic} {
83    depends_lib-delete    port:mecab-jumandic-utf8
84    depends_lib-append    port:mecab-ipadic-utf8
85
86    configure.args-append --with-mecab-dict=IPA
87}
88
89variant naistjdic conflicts ipadic unidic description {Build a parser with auto POSs given by MeCab/NAIST-jdic} {
90    depends_lib-delete    port:mecab-jumandic-utf8
91    depends_lib-append    port:mecab-naist-jdic-utf8
92
93    configure.args-append --with-mecab-dict=NAIST-J
94}
95
96variant unidic conflicts ipadic naistjdic description {Build a parser with auto POSs given by MeCab/UNIdic} {
97    depends_lib-delete    port:mecab-jumandic-utf8
98    depends_lib-append    port:unidic-mecab
99
100    configure.args-append --with-mecab-dict=UNI
101}
102
103if {![variant_isset kyoto] && ![variant_isset kyoto_partial]} {
104    default_variants +knbc
105}
106
107post-destroot {
108    set docdir ${prefix}/share/doc/${name}
109    xinstall -d ${destroot}${docdir}
110    xinstall -m 644 -W ${worksrcpath} \
111        AUTHORS COPYING GPL LGPL README THANKS \
112        ${destroot}${docdir}
113}
114
115livecheck.type      regex
116livecheck.regex     "${name}-(\\d+(?:\\-\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.