Skip to content

Commit

Permalink
#176 Updating tests from replacing lucene filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Dec 16, 2024
1 parent 96238d3 commit f898301
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void filter1() throws Exception {

final FilterResult filterResult = filter.filter(getPolicy(), "context", "documentid", PIECE, "Went to WMC", attributes);
showSpans(filterResult.getSpans());
Assertions.assertEquals(4, filterResult.getSpans().size());
Assertions.assertEquals(1, filterResult.getSpans().size());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ public FilterResult filter(Policy policy, String context, String documentId, int
final Map<Integer, Map<String, Position>> ngrams = new HashMap<>();
ngrams.put(0, splitWithIndexes(input, " "));

for(int x = 1; x < 10; x++) {
final int maxNgrams;

if(filterType == FilterType.HOSPITAL) {
maxNgrams = 20;
} else {
maxNgrams = 5;
}

for(int x = 1; x < maxNgrams; x++) {
ngrams.put(x, getNgrams(input, x));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ KHOU
RRMC
BMCSC
NFRMC
MCNH(
MCNH
TCH
KMH
OVH
Expand Down Expand Up @@ -2392,7 +2392,7 @@ BHCMH
FHS-FW
NSH
AOMC
SMH(T)
SMH
CVPHMC
PBH
WMHI
Expand Down Expand Up @@ -2647,7 +2647,7 @@ JSH
RUH
HSJH
MCHR
UHOB(D)
UHOB
CSHAC
MHL
NOCHS
Expand All @@ -2660,7 +2660,7 @@ VWJHV
HCH
WMC&S
HCHAC
SHFC(
SHFC
RJAPR
BMH
RSMC
Expand Down Expand Up @@ -3484,7 +3484,7 @@ MRH
GAMC
LMHS
SCH
UOTMC(
UOTMC
NCH
GPMH
HMC
Expand Down Expand Up @@ -3842,7 +3842,7 @@ BMHUC
SVH
SMC
BH
M(NMC
MNMC
CMH
IGH
PHC
Expand Down Expand Up @@ -4796,7 +4796,7 @@ AAC
AC
ASC
AWC
AGH(LH
AGHLH
AMC
AGH
ARMC
Expand Down Expand Up @@ -6946,7 +6946,7 @@ SMRMC
SMRMC
SMRMCoR
SMSHH
SPH(N
SPHN
SPGH
SRMC
SRDH-RDLC
Expand Down

0 comments on commit f898301

Please sign in to comment.