atilika / kuromoji

Kuromoji is a self-contained and very easy to use Japanese morphological analyzer designed for search
Apache License 2.0
950 stars 131 forks source link

How to use Kuromoji in Gradle? #120

Closed weituotian closed 6 years ago

weituotian commented 6 years ago
   // https://mvnrepository.com/artifact/org.atilika.kuromoji/kuromoji
    compile group: 'org.atilika.kuromoji', name: 'kuromoji', version: '0.9.0'

and it will cause an error!

Error:Failed to resolve: org.atilika.kuromoji:kuromoji:0.9.0
cmoen commented 6 years ago

Could you try com.atilika.kuromoji: kuromoji-ipadic:0.9.0 and see how that goes? Thanks.

weituotian commented 6 years ago

q -20171005101703

@cmoen it get the same error!

q -20171005101749

iwatake2222 commented 6 years ago

I just faced a similar issue. The following build.gradle worked to me. "pickFirst" is kind of workaround and there should be the better way.

android {
    packagingOptions {
        pickFirst 'META-INF/CONTRIBUTORS.md'
        pickFirst 'META-INF/LICENSE.md'
    }
}

dependencies {
    // https://mvnrepository.com/artifact/com.atilika.kuromoji/kuromoji-ipadic
    compile group: 'com.atilika.kuromoji', name: 'kuromoji-ipadic', version: '0.9.0'

}
weituotian commented 6 years ago

@cmoen @take-iwiw your solution is very excellent! it had solved this problem!thanks so much!