Skip to content

Commit

Permalink
fix(Acronyms): Building name check
Browse files Browse the repository at this point in the history
Correctly handle acronyms in last segment of a building name
  • Loading branch information
cblanc committed Dec 14, 2023
1 parent 15ddc02 commit f43a741
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ export const checkBuildingRange = (
): BuildingRangeMatch | void => {
const tokens = building_name.split(" ");
const range = tokens.pop() || "";
const tokenCopy = [...tokens];
const rangeCheck = tokenCopy.pop() || "";
if(isSingleCharacter(rangeCheck)) return

// Check if final token is single character [A-Z]
const rangeCheck = [...tokens].pop() || "";
if (isSingleCharacter(rangeCheck)) return;

if (range.match(BUILDING_RANGE_REGEX)) {
return {
range,
Expand Down

1 comment on commit f43a741

@vercel
Copy link

@vercel vercel bot commented on f43a741 Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.