From issues-return-72153-archive-asf-public=cust-asf.ponee.io@commons.apache.org Sun Mar 3 05:09:11 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id AA30B18077F for ; Sun, 3 Mar 2019 06:09:10 +0100 (CET) Received: (qmail 95340 invoked by uid 500); 3 Mar 2019 05:09:09 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 94967 invoked by uid 99); 3 Mar 2019 05:09:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Mar 2019 05:09:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 10E60C2241 for ; Sun, 3 Mar 2019 05:09:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.5 X-Spam-Level: X-Spam-Status: No, score=-109.5 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 88k4HoBZmwnO for ; Sun, 3 Mar 2019 05:09:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 63C406108F for ; Sun, 3 Mar 2019 05:09:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0E837E283E for ; Sun, 3 Mar 2019 05:09:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7C1E42570B for ; Sun, 3 Mar 2019 05:09:01 +0000 (UTC) Date: Sun, 3 Mar 2019 05:09:01 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (TEXT-126) Dice's Coefficient Algorithm in String similarity MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TEXT-126?focusedWorklogId=3D20= 6846&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpane= l#worklog-206846 ] ASF GitHub Bot logged work on TEXT-126: --------------------------------------- Author: ASF GitHub Bot Created on: 03/Mar/19 05:08 Start Date: 03/Mar/19 05:08 Worklog Time Spent: 10m=20 Work Description: kinow commented on pull request #103: TEXT-126: Add= ing Sorensen-Dice similarity algoritham URL: https://github.com/apache/commons-text/pull/103#discussion_r261851599 =20 =20 ########## File path: src/test/java/org/apache/commons/text/similarity/SorensenDicesS= imilarityTest.java ########## @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= . + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.text.similarity; + +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentExc= eption; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Unit tests for {@link SorensenDicesSimilarity}. + */ +public class SorensenDicesSimilarityTest { + + private static SorensenDicesSimilarity similarity; + + @BeforeAll + public static void setUp() { + similarity =3D new SorensenDicesSimilarity(); + } + + @Test + public void test() { + assertEquals(0.25d, similarity.apply("night", "nacht")); =20 Review comment: Oh, we already got a test here, so if we add it to the Javadoc, then we = don't even need to add a test. =20 And great coverage in your tests :clap: thanks! =20 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 206846) Time Spent: 6h (was: 5h 50m) > Dice's Coefficient Algorithm in String similarity > ------------------------------------------------- > > Key: TEXT-126 > URL: https://issues.apache.org/jira/browse/TEXT-126 > Project: Commons Text > Issue Type: Improvement > Reporter: Vicky Chawda > Priority: Major > Time Spent: 6h > Remaining Estimate: 0h > > I'd like to propose an extension to the algorithms for string similarity = in=C2=A0*commons-text/src/main/java/org/apache/commons/text/similarity/* > =C2=A0Dice's Coefficient Algorithm can be helpful for many who are lookin= g for ranking similarities in strings. > *Inspired from* - [http://www.catalysoft.com/articles/StrikeAMatch.html] -- This message was sent by Atlassian JIRA (v7.6.3#76005)