Skip to content

Commit 1ac713b

Browse files
committed
Small improvement to Semantic Type NAME.FIRST_LAST to reject more company names (Issue #151) + lib upgrades
1 parent 5bf8ebe commit 1ac713b

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11

22
## Changes ##
33

4+
5+
### 17.1.10
6+
- INT: Bump logback-classic to 1.5.23, SpotBugs to 6.4.8, commons-text:1.15.0, google phonenumber to 9.0.21,
7+
- ENH: Small improvement to Semantic Type NAME.FIRST_LAST to reject more company names (Issue #151)
8+
49
### 17.1.9
510
- INT: Bump logback-classic to 1.5.21, SpotBugs to 6.4.7, commons-validator to 1.10.1, gradle to 9.2.1, google phonenumber to 9.0.19
611
- INT: Switch examples to use non-deprecated method for registering plugins

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "com.github.ben-manes.versions"
3-
id "com.github.spotbugs" version "6.4.7" apply false
3+
id "com.github.spotbugs" version "6.4.8" apply false
44
}
55

66
wrapper {

settings.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ includeBuild 'examples/core/speed'
4040
dependencyResolutionManagement {
4141
versionCatalogs {
4242
libs {
43-
version('fta', '17.1.9')
43+
version('fta', '17.1.10')
4444
version('jacoco', '0.8.12')
4545

4646
// https://mvnrepository.com/artifact/de.siegmar/fastcsv
@@ -58,9 +58,9 @@ dependencyResolutionManagement {
5858
// https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jsr310
5959
library('jacksonDataType', 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.1')
6060
// https://mvnrepository.com/artifact/com.googlecode.libphonenumber/libphonenumber
61-
library('googlePhoneNumber', 'com.googlecode.libphonenumber:libphonenumber:9.0.20')
61+
library('googlePhoneNumber', 'com.googlecode.libphonenumber:libphonenumber:9.0.21')
6262
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
63-
library('commonsText', 'org.apache.commons:commons-text:1.14.0')
63+
library('commonsText', 'org.apache.commons:commons-text:1.15.0')
6464
// https://mvnrepository.com/artifact/com.github.krraghavan/xeger
6565
library('xeger', 'com.github.krraghavan:xeger:1.0.0-RELEASE')
6666
// https://mvnrepository.com/artifact/dk.brics.automaton/automaton
@@ -70,7 +70,7 @@ dependencyResolutionManagement {
7070
// https://mvnrepository.com/artifact/com.google.guava/guava
7171
library('guava', 'com.google.guava:guava:33.5.0-jre')
7272
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
73-
library('logbackClassic', 'ch.qos.logback:logback-classic:1.5.21')
73+
library('logbackClassic', 'ch.qos.logback:logback-classic:1.5.23')
7474
// https://mvnrepository.com/artifact/com.datadoghq/sketches-java
7575
library('sketches', 'com.datadoghq:sketches-java:0.8.3')
7676
}

types/src/main/java/com/cobber/fta/plugins/NameFirstLast.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,16 @@ public class NameFirstLast extends LogicalTypeInfinite {
5050

5151
static {
5252
excludes = new HashSet<>();
53+
excludes.add("COMPANY");
54+
excludes.add("CORP");
55+
excludes.add("CORP.");
56+
excludes.add("CORPORATION");
5357
excludes.add("INC");
5458
excludes.add("INC.");
59+
excludes.add("INCORPORATED");
60+
excludes.add("LIMITED");
5561
excludes.add("LLC");
62+
excludes.add("SERVICES");
5663
}
5764

5865
/**
@@ -169,7 +176,7 @@ public boolean isValid(final String input, final boolean detectMode, final long
169176
final String firstName = trimmed.substring(0, firstSpace);
170177
final String lastName = trimmed.substring(lastSpace + 1);
171178

172-
if (excludes.contains(lastName))
179+
if (excludes.contains(lastName.toUpperCase(locale)))
173180
return false;
174181

175182
firstNames.mergeIfSpace(firstName, count, Long::sum);

0 commit comments

Comments
 (0)