diff --git a/package.json b/package.json index 1cf29d7..3faaa3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clerkent", - "version": "2.4.3", + "version": "2.4.4", "private": true, "description": "quick search for international caselaw and legislation", "repository": "https://github.com/lacuna-technologies/clerkent.git", diff --git a/src/utils/Finder/CaseCitationFinder/SG.ts b/src/utils/Finder/CaseCitationFinder/SG.ts index 0c0c5bc..45e7327 100644 --- a/src/utils/Finder/CaseCitationFinder/SG.ts +++ b/src/utils/Finder/CaseCitationFinder/SG.ts @@ -4,14 +4,18 @@ import type { CaseCitationFinderResult } from './types' export const SGAbbrs = [ { abbr: `SGCA`, appendum: `(I)?` }, - { abbr: `SGHC`, appendum: `(I)?` }, + { abbr: `SGHC`, appendum: `(F|\\(I\\))?` }, { abbr: `SLR`, appendum: `(\\(r\\))?` }, { abbr: `SGDC` }, { abbr: `SGMC` }, { abbr: `SGIPOS` }, ] -export const sortSGCitations = (citationsArray: any[], attribute = null) => sortCitationsByVolume(SGAbbrs, citationsArray, attribute) +export const sortSGCitations = (citationsArray: any[], attribute = null) => sortCitationsByVolume( + SGAbbrs, + citationsArray, + attribute, +) export const findSGCaseCitationMatches = (query: string) => { const regex = new RegExp(`\\[[12]\\d{3}]( \\d{1,2})? (${ diff --git a/src/utils/scraper/SG/SG.ts b/src/utils/scraper/SG/SG.ts index 8c27f6a..0f5e2fa 100644 --- a/src/utils/scraper/SG/SG.ts +++ b/src/utils/scraper/SG/SG.ts @@ -13,7 +13,7 @@ const getLegislation = SSO.getLegislation const getCaseByName = async (caseName: string): Promise => { try { const results = (await Promise.allSettled([ - // SGSC.getCaseByName(caseName), + SGSC.getCaseByName(caseName), // SLW.getCaseByName(caseName), Common.CommonLII.getCaseByName(caseName, Constants.JURISDICTIONS.SG.name), ])) diff --git a/src/utils/scraper/SG/SLW.ts b/src/utils/scraper/SG/SLW.ts index cd88080..ba23509 100644 --- a/src/utils/scraper/SG/SLW.ts +++ b/src/utils/scraper/SG/SLW.ts @@ -29,7 +29,10 @@ const getCaseByCitation = async (citation: string): Promise => { const results = data .map(([name, link]) => parseCase(name, link)) - .filter(({ citation}) => Helpers.isCitationValid(citation)) + .filter(({ citation: scrapedCitation }) => ( + Helpers.isCitationValid(scrapedCitation) && + citation === scrapedCitation + )) Logger.log(`SLW scrape results`, results) return results }