Skip to content

Commit ed5da60

Browse files
committed
fixes aps fullname detection when textract output says "bil" instead of "bill"
1 parent ac00f85 commit ed5da60

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/documentTypes/apsBill.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ module.exports = {
3535
const first3Lines = rawText.slice(0, 3);
3636
fullName = first3Lines.find((line) => (
3737
line !== 'aps'
38-
&& line !== 'Your electricity bill'
38+
&& !line.match(/Your electricity bill?/gi)
3939
&& !line.match(/Bill? date/gi)
4040
&& !line.match(/\d+/g)
4141
));
42+
4243
if (!fullName) {
4344
fullName = rawText.slice(lineWithCityStateZipCodeIndex - 5, lineWithCityStateZipCodeIndex + 5)
4445
.filter((line) => (

lib/documentTypes/arizonaDriverLicense.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ module.exports = {
4848
if (!street_address_line_1 && lineWithCityStateZipIndex > 0) {
4949
street_address_line_1 = rawText[lineWithCityStateZipIndex - 1];
5050
}
51-
if (lineWithCityStateZip === street_address_line_2 || street_address_line_1 === street_address_line_2) {
51+
if (lineWithCityStateZip === street_address_line_2
52+
|| street_address_line_1 === street_address_line_2) {
5253
// case of no street_address_line_2
5354
street_address_line_2 = '';
5455
}

lib/documentTypes/southwestGasBill.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ module.exports = {
4343
first_name = customer.split(' or ')[0].split(' ').slice(0, 1).join(' ');
4444
last_name = customer.split(' or ')[0].split(' ').slice(1, 2).join(' ');
4545
}
46-
console.log(customer);
4746

4847
// street address line 1 & 2
4948
const lineWithCityStateZipCodeIndex = rawText.findIndex((line) => line.match(/^[A-Z\s]+ [A-Z]{2} \d+-?\d+$/g));

0 commit comments

Comments
 (0)