Lawtext core references / core/src/analyzer/detectDeclarations/processLawTitleAlias
core/src/analyzer/detectDeclarations/processLawTitleAlias
Interfaces
Type Aliases
LawNumsByLawTitle
LawNumsByLawTitle = (
lawTitle) => readonlystring[]
Defined in: core/src/analyzer/detectDeclarations/processLawTitleAlias.ts:16
Parameters
lawTitle
string
Returns
readonly string[]
LawTitleResolvedBy
LawTitleResolvedBy =
"declared"|"lawList"
Defined in: core/src/analyzer/detectDeclarations/processLawTitleAlias.ts:24
Functions
lawTitleWithoutLawNumMessage()
lawTitleWithoutLawNumMessage(
processName,lawTitle,__namedParameters):string
Defined in: core/src/analyzer/detectDeclarations/processLawTitleAlias.ts:31
Parameters
processName
string
lawTitle
string
__namedParameters
Returns
string
processLawTitleAlias()
processLawTitleAlias(
sentenceEnvsStruct,declarations,lawRefs,lawNumsByLawTitle,lawTitleByLawNum?):WithErrorValue<LawTitleAliasLawRef[]>
Defined in: core/src/analyzer/detectDeclarations/processLawTitleAlias.ts:442
Link a name declared for a law title without LawNum to the law.
e.g. “金融商品取引法(以下「法」という。)”, “「法」とは、電波法をいう。”
This handles only the references by a law title without LawNum, which processLawRef does not handle. The references with LawNum (e.g. “電波法(昭和二十五年法律第百三十一号。以下「法」という。)”) are already handled by processLawRef, and are not processed again here:
- processLawRef generates “LawTitle” declarations, while only “Keyword” declarations are processed here.
- The parentheses including LawNum do not match the parentheses consisting only of the declaration of a name.
- The children of ____LawRef are not traversed.
This does not search law titles everywhere in the text. Only a law title accompanied by a declaration of a name (“法”, “番号利用法”, etc.) is processed:
- A law title immediately followed by parentheses consisting only of the declaration of a name (e.g. “金融商品取引法(以下「法」という。)”). The law title is searched only at the end of the text preceding the parentheses.
- A “Keyword” declaration whose value is exactly a law title (e.g. “「法」とは、電波法をいう。”). A law title without such a declaration (e.g. “金融商品取引法第二条”) is not processed here, but by processLawTitleBeforePointerRanges (after detectVariableReferences).
The LawNum is searched in the following order:
- LawTitles referred with LawNum in the same law (the suggestedLawTitle of the LawRef’s), or aliases declared with LawNum in the same law (only within the scopes of the declarations)
- the law list (only if the LawTitle is unique, or can be chosen by the LawNum’s referred in the same law)
Each link is recorded in the errors (see lawTitleWithoutLawNumMessage), since it is a guess from the law title.
Parameters
sentenceEnvsStruct
declarations
lawRefs
readonly ____LawRef[]
lawNumsByLawTitle
LawNumsByLawTitle | null
lawTitleByLawNum?
LawTitleByLawNum | null = null
Returns
WithErrorValue<LawTitleAliasLawRef[]>
processLawTitleBeforePointerRanges()
processLawTitleBeforePointerRanges(
sentenceEnvsStruct,declarations,lawRefs,lawNumsByLawTitle,lawTitleByLawNum?):WithErrorValue<LawTitleBeforePointerRangesLawRef[]>
Defined in: core/src/analyzer/detectDeclarations/processLawTitleAlias.ts:575
Link a law title without LawNum immediately followed by a named PointerRanges to the law.
e.g. “検察庁法第二条第四項の規定により、…”, ”…の相続人又は民法第九百五十一条の法人”
This must be called after detectVariableReferences:
- A law title declared with LawNum in the same law (e.g. “地方自治法(昭和二十二年法律第六十七号)”) is already replaced by a ____VarRef within the scope of the declaration, and is resolved via the declaration. This keeps the existing results, and only the remaining text is processed here.
- A name declared in the same law (e.g. “新失業保険法”) is also already replaced by a ____VarRef, so a part of the name (e.g. “保険法”) is not taken as a law title here.
The law title is searched at the end of the text immediately preceding the PointerRanges, with the longest match to the law titles (e.g. “学校教育法施行規則” rather than “学校教育法”), in the same way as processLawTitleAlias (LawTitleResolver.findLawTitleAtEnd). Therefore:
- “この法律”, “同法”, etc. are not processed, since they are not law titles in the law list.
- The text preceding the law title is not checked, like processLawTitleAlias. The versions (“旧”, “改正前の”, etc.) are not distinguished, and a law title not in the law list (a repealed law, a common name, etc.) whose end matches a shorter law title is linked to the shorter one (e.g. “失業保険法第十条” → 保険法).
- The own law is not linked (left as it is).
The LawNum is resolved in the same way as processLawTitleAlias (LawTitleResolver.resolve). (The aliases declared with LawNum are already replaced by ____VarRef’s within their scopes, and are not used out of their scopes.) If the LawNum cannot be determined (e.g. ambiguous law titles), the text is left as it is.
Each link is recorded in the errors (see lawTitleWithoutLawNumMessage), since it is a guess from the law title.
Parameters
sentenceEnvsStruct
declarations
lawRefs
readonly ____LawRef[]
lawNumsByLawTitle
LawNumsByLawTitle | null
lawTitleByLawNum?
LawTitleByLawNum | null = null
Returns
WithErrorValue<LawTitleBeforePointerRangesLawRef[]>
References
default
Renames and re-exports processLawTitleAlias