nineteen

It is determined whether or not the haiku

License

License

Categories

Categories

Net
GroupId

GroupId

com.github.masahitojp
ArtifactId

ArtifactId

nineteen
Last Version

Last Version

0.0.6
Release Date

Release Date

Type

Type

jar
Description

Description

nineteen
It is determined whether or not the haiku

Download nineteen

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.masahitojp/nineteen/ -->
<dependency>
    <groupId>com.github.masahitojp</groupId>
    <artifactId>nineteen</artifactId>
    <version>0.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.masahitojp/nineteen/
implementation 'com.github.masahitojp:nineteen:0.0.6'
// https://jarcasting.com/artifacts/com.github.masahitojp/nineteen/
implementation ("com.github.masahitojp:nineteen:0.0.6")
'com.github.masahitojp:nineteen:jar:0.0.6'
<dependency org="com.github.masahitojp" name="nineteen" rev="0.0.6">
  <artifact name="nineteen" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.masahitojp', module='nineteen', version='0.0.6')
)
libraryDependencies += "com.github.masahitojp" % "nineteen" % "0.0.6"
[com.github.masahitojp/nineteen "0.0.6"]

Dependencies

compile (1)

Group / Artifact Type Version
com.atilika.kuromoji : kuromoji-unidic jar 0.9.0

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

nineteen

Find a Senryu from text for Java SE 8. Inspired by ruby/ikku.

Getting Started

Write simple java application

import java.util.Optional;
import java.util.stream.Collectors;
import com.github.masahitojp.nineteen.*;

public class Main {
    public static String toSenryuString(final Optional<Song> songOpt) {
        return songOpt.map(song -> song.getPhrases().stream()
              .map(list -> list.stream().map(Token::toString).collect(Collectors.joining()))
              .collect(Collectors.joining(" "))).orElse("");
    }

    public static void main(String[] args) {
        final Reviewer reviewer = new Reviewer();
        final String haiku1 = "古池や蛙飛び込む水の音";

        System.out.println(toSenryuString(reviewer.find(haiku1)));
        // -> "古池や 蛙飛び込む 水の音"
    }
}

Add dependency to your build.gradle

apply plugin: 'java'

repositories.mavenCentral()

dependencies {
      compile 'com.github.masahitojp:nineteen:0.0.6'
}

sourceCompatibility = targetCompatibility = 1.8

License

Apache License, Version 2.0

Inspired projects

Badges

build status

Versions

Version
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1.0