[
https://issues.apache.org/jira/browse/TEXT-155?focusedWorklogId=210636&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-210636
]
ASF GitHub Bot logged work on TEXT-155:
---------------------------------------
Author: ASF GitHub Bot
Created on: 10/Mar/19 04:41
Start Date: 10/Mar/19 04:41
Worklog Time Spent: 10m
Work Description: kinow commented on issue #109: TEXT-155: Add a generic
OverlapSimilarity measure
URL: https://github.com/apache/commons-text/pull/109#issuecomment-471246698
@aherbert updated the JIRA issue, and was going to merge and add the
`changes.xml` entry, but noticed the broken Travis-CI build.
Could you fix the build, and then if you would like too, merge & resolve the
ticket, please? Here's a snippet of the log in Travis:
```
[INFO] There are 2 errors reported by Checkstyle 8.18 with
/home/travis/build/apache/commons-text/checkstyle.xml ruleset.
[ERROR]
src/test/java/org/apache/commons/text/similarity/OverlapSimilarityTest.java:[179]
(regexp) RegexpSingleline: Line has trailing spaces.
[ERROR]
src/test/java/org/apache/commons/text/similarity/OverlapSimilarityTest.java:[192]
(regexp) RegexpSingleline: Line has trailing spaces.
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 43.295 s
[INFO] Finished at: 2019-03-09T21:22:18Z
[INFO] Final Memory: 57M/734M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (default-cli) on
project commons-text: You have 2 Checkstyle violations. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The command "mvn" exited with 1.
```
Cheers
Bruno
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 210636)
Time Spent: 4h 20m (was: 4h 10m)
> Add a generic OverlapSimilarity measure
> ---------------------------------------
>
> Key: TEXT-155
> URL: https://issues.apache.org/jira/browse/TEXT-155
> Project: Commons Text
> Issue Type: New Feature
> Affects Versions: 1.6
> Reporter: Alex D Herbert
> Priority: Minor
> Fix For: 1.7
>
> Time Spent: 4h 20m
> Remaining Estimate: 0h
>
> The {{SimilarityScore<T>}} interface can be used to compute a generic result.
> I propose to add a class that can compute the intersection between two sets
> formed from the characters. The sets must be formed from the {{CharSequence}}
> input to the {{apply}} method using a {{Function<CharSequence, Set<T>>}} to
> convert the {{CharSequence}}. This function can be passed to the
> {{SimilarityScore<T>}} during construction.
> The result can then be computed to have the size of each set and the
> intersection.
> I have created an implementation that can compute the equivalent of the
> {{JaccardSimilary}} class by creating {{Set<Character>}} and also the
> F1-score using bigrams (pairs of characters) by creating {{Set<String>}}.
> This relates to
> [Text-126|https://issues.apache.org/jira/projects/TEXT/issues/TEXT-126] which
> suggested an algorithm for the Sorensen-Dice similarity, also known as the
> F1-score.
> Here is an example:
> {code:java}
> // Match the functionality of the JaccardSimilarity class
> Function<CharSequence, Set<Character>> converter = (cs) -> {
> final Set<Character> set = new HashSet<>();
> for (int i = 0; i < cs.length(); i++) {
> set.add(cs.charAt(i));
> }
> return set;
> };
> IntersectionSimilarity<Character> similarity = new
> IntersectionSimilarity<>(converter);
> IntersectionResult result = similarity.apply("something", "something else");
> {code}
> The result has the size of set A, set B and the intersection between them.
> This class was inspired by my look through the various similarity
> implementations. All of them except the {{CosineSimilarity}} perform single
> character matching between the input {{CharSequence}}s. The
> {{CosineSimilarity}} tokenises using whitespace to create words.
> This more generic type of implementation will allow a user to determine how
> to divide the {{CharSequence}} but to create the sets that are compared, e.g.
> single characters, words, bigrams, etc.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)