Improve handling of articles named 'Annexe'
This commit is contained in:
parent
dad66869ac
commit
3e8165ac4c
1 changed files with 2 additions and 2 deletions
|
@ -117,7 +117,7 @@ function articleNumberSegmentToPriorityAndNumber(
|
||||||
[...s].reduce((sum, letter) => sum * 256 + letter.charCodeAt(0), 0),
|
[...s].reduce((sum, letter) => sum * 256 + letter.charCodeAt(0), 0),
|
||||||
],
|
],
|
||||||
[semelBisTerEtcRegExp, (s) => numberBySemelBisTerEtc[s] ?? 9999],
|
[semelBisTerEtcRegExp, (s) => numberBySemelBisTerEtc[s] ?? 9999],
|
||||||
[/^Annexe article$/, () => 1],
|
[/^Annexe/, () => 1],
|
||||||
] as Array<[RegExp, (s: string) => number]>
|
] as Array<[RegExp, (s: string) => number]>
|
||||||
).entries()) {
|
).entries()) {
|
||||||
if (regExp.test(segment)) {
|
if (regExp.test(segment)) {
|
||||||
|
@ -142,7 +142,7 @@ function splitArticleNumber(articleNumber: string): string[] {
|
||||||
.filter((segment) => segment !== "")
|
.filter((segment) => segment !== "")
|
||||||
.map((segment) => segment.replace(/^1er$/, "1"))
|
.map((segment) => segment.replace(/^1er$/, "1"))
|
||||||
if (annexe) {
|
if (annexe) {
|
||||||
segments.push("Annexe article")
|
segments.push("Annexe")
|
||||||
}
|
}
|
||||||
return segments.reduce((segments: string[], segment: string) => {
|
return segments.reduce((segments: string[], segment: string) => {
|
||||||
if (/^[A-Z]{2,3}$/.test(segment)) {
|
if (/^[A-Z]{2,3}$/.test(segment)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue