Skip to content

Commit

Permalink
Merge pull request #118 from tamada/release/v2.5.2
Browse files Browse the repository at this point in the history
Release/v2.5.2
  • Loading branch information
tamada authored Sep 14, 2021
2 parents 965490d + c59f0eb commit 43282b5
Show file tree
Hide file tree
Showing 19 changed files with 135 additions and 75 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
[![codebeat badge](https://codebeat.co/badges/8e8c5e70-cb07-4f58-941c-3ddb64f3c059)](https://codebeat.co/projects/github-com-tamada-pochi-main)

[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://github.com/tamada/pochi/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/Version-2.5.1-green.svg)](https://github.com/tamada/pochi/releases/tag/v2.5.1)
[![Version](https://img.shields.io/badge/Version-2.5.2-green.svg)](https://github.com/tamada/pochi/releases/tag/v2.5.2)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.4271132-green.svg)](https://zenodo.org/badge/latestdoi/82773287)

[![Javadoc](https://img.shields.io/badge/Javadoc-v2.5.1-blue?logo=java)](https://tamada.github.io/pochi/apidocs)
[![Docker](https://img.shields.io/badge/Docker-ghcr.io%2Ftamada%2Fpochi%3A2.5.1-blue?logo=docker)](https://github.com/users/tamada/packages/container/package/pochi)
[![Javadoc](https://img.shields.io/badge/Javadoc-v2.5.2-blue?logo=java)](https://tamada.github.io/pochi/apidocs)
[![Docker](https://img.shields.io/badge/Docker-ghcr.io%2Ftamada%2Fpochi%3A2.5.2-blue?logo=docker)](https://github.com/users/tamada/packages/container/package/pochi)
[![GitHub Discussion](https://img.shields.io/badge/GitHub-Discussions-blue?logo=github)](https://github.com/tamada/pochi/discussions)

Detecting the software theft, the birthmark toolkit for the JVM platform.
Expand Down Expand Up @@ -83,9 +83,10 @@ For more detail, see [:ant: Examples](https://tamada.github.io/pochi/examples).
Container images of **pochi** for Docker are:
* [`ghcr.io/tamada/pochi`](https://github.com/users/tamada/packages/container/package/pochi)
* `2.5.1`, `latest`
* `2.5.0`
* `2.4.6`
* `2.5.2`, `latest`
* `2.5.1`
* `2.5.0`
* `2.4.6`
* `2.4.0`
* `2.3.24`
* `2.3.23`
Expand All @@ -105,7 +106,7 @@ Container images of **pochi** for Docker are:
* `1.0.0`
* accept only `.js` script files.
[![Docker](https://img.shields.io/badge/Docker-ghcir.io%2Ftamada%2Fpochi%3A2.5.1-blue?logo=docker)](https://github.com/users/tamada/packages/container/package/pochi)
[![Docker](https://img.shields.io/badge/Docker-ghcir.io%2Ftamada%2Fpochi%3A2.5.2-blue?logo=docker)](https://github.com/users/tamada/packages/container/package/pochi)
To run **pochi** on Docker container OS, type the following commands.
Expand Down Expand Up @@ -157,10 +158,10 @@ Then, add the dependencies of your `pom.xml`.
| groupId | artifactId | version |
|--------------------|--------------|---------|
|`jp.cafebabe.pochi` | `kunai2` | `2.5.1` |
|`jp.cafebabe.pochi` | `pochi-core` | `2.5.1` |
|`jp.cafebabe.pochi` | `pochi-api` | `2.5.1` |
|`jp.cafebabe.pochi` | `pochi-cmd` | `2.5.1` |
|`jp.cafebabe.pochi` | `kunai2` | `2.5.2` |
|`jp.cafebabe.pochi` | `pochi-core` | `2.5.2` |
|`jp.cafebabe.pochi` | `pochi-api` | `2.5.2` |
|`jp.cafebabe.pochi` | `pochi-cmd` | `2.5.2` |
## Modules
Expand Down
2 changes: 1 addition & 1 deletion bin/build_site.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

VERSION="2.5.1"
VERSION="2.5.2"

function build_apidocs() {
mkdir -p site/msp
Expand Down
2 changes: 1 addition & 1 deletion bin/make_dist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

VERSION="2.5.1"
VERSION="2.5.2"

function mkdirIfNeeded () {
if [ ! -d $1 ] ; then
Expand Down
2 changes: 1 addition & 1 deletion bin/update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ for i in README.md site/content/_index.md site/content/description.md ; do
done

for i in README.md site/content/description.md ; do
sed "s/ \* \`\([0-9.]*\)\`, \`latest\`/ * \`${VERSION}\`, \`latest\`\n * \`\1\`/g" $i > a ; mv a "$i"
sed "s/ \* \`\([0-9.]*\)\`, \`latest\`/ * \`${VERSION}\`, \`latest\`\n * \`\1\`/g" $i > a ; mv a "$i"
done

for i in README.md site/content/install.md ; do
Expand Down
2 changes: 1 addition & 1 deletion dockers/pochi-groovysh/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN apk --no-cache add openjdk11=11.0.4_p4-r1 \
# building pochi
FROM alpine:3.10.1

ARG PochiVersion="2.5.1"
ARG PochiVersion="2.5.2"
ARG GroovyVersion="3.0.9"

LABEL maintainer="Haruaki Tamada" \
Expand Down
2 changes: 1 addition & 1 deletion dockers/pochi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN apk --no-cache add openjdk11=11.0.4_p4-r1 \
# building pochi
FROM alpine:3.10.1

ARG PochiVersion="2.5.1"
ARG PochiVersion="2.5.2"

LABEL maintainer="Haruaki Tamada" \
pochi-version="${PochiVersion}" \
Expand Down
2 changes: 1 addition & 1 deletion kunai2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions pochi-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</parent>

<groupId>jp.cafebabe.pochi</groupId>
Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>kunai2</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public Threshold(double threshold){
}

public boolean isStolen(Similarity similarity){
return similarity.value >= (1 - value);
return similarity.value >= value;
}

public boolean isInconclusive(Similarity similarity){
Expand All @@ -23,7 +23,7 @@ public boolean isInconclusive(Similarity similarity){
}

public boolean isInnocent(Similarity similarity){
return similarity.value <= value;
return similarity.value <= (1 - value);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,50 +48,104 @@ public void testToString() {

assertThat(comparison.toString(), is("className1,className2,0.75"));
}

@Test
public void testThreshold() {
Comparison<String> comparison1 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.75));
Comparison<String> comparison2 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.5));
Comparison<String> comparison3 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.15));
public void testThresholdCase0() {
Comparison<String> comparison = new Comparison<>(birthmark1, birthmark2, new Similarity(0.6));
Threshold threshold = new Threshold(0.75);

assertThat(comparison.isStolen(threshold), is(false));
assertThat(comparison.isInconclusive(threshold), is(true));
assertThat(comparison.isInnocent(threshold), is(false));
}

@Test
public void testThresholdCase1() {
Comparison<String> comparison1 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.75));
Threshold threshold1 = new Threshold(0.3);

assertThat(comparison1.isStolen(threshold1), is(true));
assertThat(comparison1.isInconclusive(threshold1), is(false));
assertThat(comparison1.isInnocent(threshold1), is(false));
}

assertThat(comparison2.isStolen(threshold1), is(false));
assertThat(comparison2.isInconclusive(threshold1), is(true));
assertThat(comparison2.isInnocent(threshold1), is(false));
@Test
public void testThresholdCase2() {
Comparison<String> comparison2 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.5));
Threshold threshold1 = new Threshold(0.3);

assertThat(comparison2.isStolen(threshold1), is(true));
assertThat(comparison2.isInconclusive(threshold1), is(false));
assertThat(comparison2.isInnocent(threshold1), is(true));
}

@Test
public void testThresholdCase3() {
Comparison<String> comparison3 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.15));
Threshold threshold1 = new Threshold(0.3);

assertThat(comparison3.isStolen(threshold1), is(false));
assertThat(comparison3.isInconclusive(threshold1), is(false));
assertThat(comparison3.isInnocent(threshold1), is(true));
}

@Test
public void testThresholdCase4() {
Comparison<String> comparison1 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.75));
Threshold threshold2 = new Threshold(0.2);
assertThat(comparison1.isStolen(threshold2), is(false));
assertThat(comparison1.isInconclusive(threshold2), is(true));
assertThat(comparison1.isInnocent(threshold2), is(false));

assertThat(comparison2.isStolen(threshold2), is(false));
assertThat(comparison2.isInconclusive(threshold2), is(true));
assertThat(comparison2.isInnocent(threshold2), is(false));
assertThat(comparison1.isStolen(threshold2), is(true));
assertThat(comparison1.isInconclusive(threshold2), is(false));
assertThat(comparison1.isInnocent(threshold2), is(true));
}

@Test
public void testThresholdCase5() {
Comparison<String> comparison2 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.5));
Threshold threshold2 = new Threshold(0.2);

assertThat(comparison2.isStolen(threshold2), is(true));
assertThat(comparison2.isInconclusive(threshold2), is(false));
assertThat(comparison2.isInnocent(threshold2), is(true));
}

@Test
public void testThresholdCase6() {
Comparison<String> comparison3 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.15));
Threshold threshold2 = new Threshold(0.2);

assertThat(comparison3.isStolen(threshold2), is(false));
assertThat(comparison3.isInconclusive(threshold2), is(false));
assertThat(comparison3.isInnocent(threshold2), is(true));
}

@Test
public void testThresholdCase7() {
Comparison<String> comparison1 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.75));
Threshold threshold3 = new Threshold(0.1);

assertThat(comparison1.isStolen(threshold3), is(true));
assertThat(comparison1.isInconclusive(threshold3), is(false));
assertThat(comparison1.isInnocent(threshold3), is(true));
}

@Test
public void testThresholdCase8() {
Comparison<String> comparison2 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.5));
Threshold threshold3 = new Threshold(0.1);

assertThat(comparison2.isStolen(threshold3), is(true));
assertThat(comparison2.isInconclusive(threshold3), is(false));
assertThat(comparison2.isInnocent(threshold3), is(true));
}

@Test
public void testThresholdCase9() {
Comparison<String> comparison3 = new Comparison<>(birthmark1, birthmark2, new Similarity(0.15));
Threshold threshold3 = new Threshold(0.1);
assertThat(comparison1.isStolen(threshold3), is(false));
assertThat(comparison1.isInconclusive(threshold3), is(true));
assertThat(comparison1.isInnocent(threshold3), is(false));

assertThat(comparison2.isStolen(threshold3), is(false));
assertThat(comparison2.isInconclusive(threshold3), is(true));
assertThat(comparison2.isInnocent(threshold3), is(false));

assertThat(comparison3.isStolen(threshold3), is(false));
assertThat(comparison3.isInconclusive(threshold3), is(true));
assertThat(comparison3.isInnocent(threshold3), is(false));

assertThat(comparison3.isStolen(threshold3), is(true));
assertThat(comparison3.isInconclusive(threshold3), is(false));
assertThat(comparison3.isInnocent(threshold3), is(true));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void testSimilarityValue(){
Similarity similarity = new Similarity(0.75);

Threshold threshold1 = new Threshold(0.3);
Threshold threshold2 = new Threshold(0.2);
Threshold threshold2 = new Threshold(0.8);

assertThat(similarity.isCloseTo(new Similarity(0.7501), 1E-2), is(true));
assertThat(similarity.isCloseTo(new Similarity(0.8), 1E-2), is(false));
Expand All @@ -45,15 +45,19 @@ public void testSimilarityValue(){
}

@Test
public void testStolen(){
Similarity similarity = new Similarity(0.25);
public void testStolenCase1(){
Similarity similarity = new Similarity(0.75);
Threshold threshold = new Threshold(0.8);

Threshold threshold1 = new Threshold(0.3);
Threshold threshold2 = new Threshold(0.2);
assertThat(similarity.isStolen(threshold), is(false));
}

assertThat(similarity.isStolen(threshold1), is(false));
assertThat(similarity.isInnocent(threshold1), is(true));
assertThat(similarity.isInconclusive(threshold2), is(true));
@Test
public void testStolenCase2(){
Similarity similarity = new Similarity(0.9);
Threshold threshold = new Threshold(0.8);

assertThat(similarity.isStolen(threshold), is(true));
}

@Test
Expand All @@ -62,7 +66,7 @@ public void testInconclusive(){
Similarity similarity2 = new Similarity(0.2);
Similarity similarity3 = new Similarity(0.8);

Threshold threshold = new Threshold(0.25);
Threshold threshold = new Threshold(0.75);

assertThat(similarity1.isInconclusive(threshold), is(true));
assertThat(similarity2.isInconclusive(threshold), is(false));
Expand Down
4 changes: 2 additions & 2 deletions pochi-cmd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</parent>

<groupId>jp.cafebabe.pochi</groupId>
Expand Down Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-core</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions pochi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -20,13 +20,13 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>kunai2</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-api</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.opennlp/opennlp-tools -->
Expand Down
2 changes: 1 addition & 1 deletion pochi-core/src/main/java/jp/cafebabe/pochi/Pochi.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Optional;

public class Pochi {
public static final String VERSION = "2.5.1";
public static final String VERSION = "2.5.2";
private static final Pochi INSTANCE = new Pochi();

private final Path home;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
<packaging>pom</packaging>

<modules>
Expand Down
6 changes: 3 additions & 3 deletions site/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ draft: false
[![codebeat badge](https://codebeat.co/badges/8e8c5e70-cb07-4f58-941c-3ddb64f3c059)](https://codebeat.co/projects/github-com-tamada-pochi-main)

[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg?style=flat)](https://github.com/tamada/pochi/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/Version-2.5.1-green.svg)](https://github.com/tamada/pochi/releases/tag/v2.5.1)
[![Version](https://img.shields.io/badge/Version-2.5.2-green.svg)](https://github.com/tamada/pochi/releases/tag/v2.5.2)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.4271132-green.svg)](https://zenodo.org/badge/latestdoi/82773287)

[![Javadoc](https://img.shields.io/badge/Javadoc-v2.5.1-blue?logo=java)](https://tamada.github.io/pochi/apidocs)
[![Docker](https://img.shields.io/badge/Docker-ghcr.io%2Ftamada%2Fpochi%3A2.5.1-blue?logo=docker)](https://github.com/users/tamada/packages/container/package/pochi)
[![Javadoc](https://img.shields.io/badge/Javadoc-v2.5.2-blue?logo=java)](https://tamada.github.io/pochi/apidocs)
[![Docker](https://img.shields.io/badge/Docker-ghcr.io%2Ftamada%2Fpochi%3A2.5.2-blue?logo=docker)](https://github.com/users/tamada/packages/container/package/pochi)
[![GitHub Discussion](https://img.shields.io/badge/GitHub-Discussions-blue?logo=github)](https://github.com/tamada/pochi/discussions)

Detecting the software theft, the birthmark toolkit for the JVM platform.
Expand Down
Loading

0 comments on commit 43282b5

Please sign in to comment.