Skip to content

Commit

Permalink
fix(parser): update parser rule for some languages
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Nov 10, 2024
1 parent fb94827 commit 2c2b9d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/parsing_rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export const extractSongNumber = (src: string) => {
export const extractSourceEnhanced = (src: string, lang: string) => {
const variations = getPartMinutesSeparatorVariations(lang);

if (src === 'Fine-Fine Things Wey You See for Bible' && lang === 'PGW') {
src = 'Fine-Fine Things Wey You See for Bible: (10 min.)';
}

// separate minutes from title
const firstPatternCommon = new RegExp(
`(.+?)(?:: )?[((](\\d+)(?: | )?(?:${variations})[))](?: : | |. )?(.+?)?$`,
Expand All @@ -30,7 +34,7 @@ export const extractSourceEnhanced = (src: string, lang: string) => {
'giu'
);

const firstPatternTW = new RegExp(`(.+?)(?: )?\\(${variations}(?: )?(\\d+)\\)(?: )?(.+?)?$`, 'giu');
const firstPatternTW = new RegExp(`(.+?)(?: )?\\(${variations}(?: )?(\\d+).?\\)(?: |.)?(.+?)?$`, 'giu');

const firstPattern: LangRegExp = {
common: firstPatternCommon,
Expand Down

0 comments on commit 2c2b9d0

Please sign in to comment.