Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions text/packages/chaff/rules/topic-predicate-distance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layer: L3
status: stable
how_to_find: topic-predicate-distance
requires: [pos]
extra_word_lists: [topic-clause-close, statute-article-opener, topic-adverb]
extra_word_lists: [topic-clause-close, statute-article-opener, topic-adverb, topic-phrase-particle]
languages: [ja]
severity: info

Expand Down Expand Up @@ -45,8 +45,8 @@ example:
来週は、新しい担当者の紹介、先月から続く予算の見直し、春の本社移転の準備、秋の採用計画の確認、年末の懇親会の段取りを話し合います。そのため定例会議は二時間に延長します。

not_flagged:
ja: 主題(名詞+は)の無い文、鉤括弧で引いたものの中、上限までの距離は見ません。主題の述語が先の節で閉じる文(「この計画は簡単ではありませんが、…」「〜であって、…」、後ろの節に別の主語がある「〜ではなく、」「〜であるため、」「〜の想定のため、」(後ろが話し手の頼み(〜していただけると、〜いただきたい)でもよい)「〜であり、」(主題との間に別の主題(〜は)が無く、文末がまた繋辞か「〜がある」でないとき。主題が行いを名詞にしたもの(〜することは重要であり、…影響を及ぼす可能性があります)なら、後ろに別の主語があれば文末は何でもよい。後ろの主語は節を名詞にしたもの(〜することが求められている)でもよく、文末の名詞に「が」の主語が付くとき(〜を図ることが必要である)や、最後の読点の後に行いを名詞にした主語(〜を行うことも、〜を図ることが)があるときは繋辞で終わっても)、受け身の「〜され、」(受け身の主語が名詞(支部が置かれ)でなく、後ろに時を言うのではない名詞の新しい主題(〜の議論は)が立ち、主題との間に別の主題が無いとき)、繋辞の理由「〜ものですから、」「〜であるので、」(後ろに時を言うのではない名詞の新しい主題(私たちは)が立ち、主題との間に別の主題が無いとき)、読点を挟まない「〜は〜で、」「〜であるならば、」「〜にあるところ、」「〜ており、」、受け身で伝える引用「〜だと言われているが」、主題と「〜ますが、」「〜ましたが、」(打ち消しの「〜ませんが、」「〜ませんでしたが、」も)の間に別の主語が無く、その後ろが別の主語(〜が)の節を経て新しい主題(〜は、〜には)に移る文か、直後に名詞の新しい主題(〜ましたが、赤澤大臣は…、〜ておりますが、本事業は、…)が立って文末まで続く文、主題が行いを名詞にしたもの(〜することは差し控えますが、…)、主題からそこまでに別の主語が無い「〜ことから、」「〜つつ、」「〜としても、」「〜こととし、」、問いの「〜のか、」(語は語彙表 topic-clause-close)、述語の後ろに丸数字の番号(③)が来て一行に詰まった箇条の次の項目が始まるところ、「〜のは」の主題が「という」で名詞に掛かる節の中で繋辞の述語を得て、その名詞句が読点で終わるところ(〜来てほしいのは日本であったという調査の結果、…)、主題が読点を挟まずに「〜という〜」の節の中で述語を得て、その名詞句の後の読点の後ろに名詞の新しい主題が立つところ(食の大部分は家庭が担っているという実態を踏まえれば、食に関する指導は、…))は、その節の終わりまでを数えます。後ろの節の主語には「〜のほとんどは」も数えます。副詞になる「は」(最後は=結局のところ。語は語彙表 topic-adverb)は主題と読みません。前に名詞や「の」が付けば(交渉の最後は)主題です。時や場面を言う「は」(今夜は、当日は、〜ときは)の後ろに別の主題があれば、その主題から数えます。時や場面を言う主題(決定後は、普及以前は)は、「〜ますが、」「〜でしたが、」の後ろに別の主語があれば、間に別の主語があってもそこまでを数えます。法令でも契約でもない文書が条文をそのまま載せた文(「第7条 …」、形は語彙表 statute-article-opener)は、書き手が直せる文ではないので数えません。英語の文書には使いません。
en: Sentences with no topic (noun + は), quotations in 「」, and distances up to the limit are not counted. When the topic gets its own predicate in an earlier clause (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜の想定のため (or followed by the speaker asking a favour, as in 〜していただけると, 〜いただきたい), 〜であり (when no other topic stands between and the sentence does not end on a copula or 〜がある again, or ends on anything when the topic is an act made a noun and a subject of its own follows (〜することは重要であり、…影響を及ぼす可能性があります); the later subject may be a clause made a noun, 〜することが求められている, and when the final noun has a subject of its own with が, 〜を図ることが必要である, or an act made a noun with が or も follows the last comma, 〜を行うことも重要な役割である, the sentence may end on a copula), a passive 〜され whose own subject is not a noun (支部が置かれ), followed by a new topic on a noun that does not set the time (〜の議論は) with no other topic between, a copula's reason 〜ものですから or 〜であるので followed by a new topic on a noun that does not set the time (私たちは) with no other topic between, 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが (or the negative 〜ませんが, 〜ませんでしたが) with no other subject between the topic and it, followed by a clause with a subject of its own (〜が) and then a new topic (〜は, 〜には), or straight away by a noun as a new topic that runs to the end (〜ましたが、赤澤大臣は…, 〜ておりますが、本事業は、…), or always when the topic is an act made a noun (〜することは差し控えますが、…); 〜ことから, 〜つつ, 〜としても, 〜こととし or a question's 〜のか with no other subject between the topic and it, from the topic-clause-close word list; a circled number (③) after a predicate, where a list run into one line starts its next item; a 〜のは topic that gets its copula inside a clause という makes a noun's content, when that noun phrase ends at a comma, as in 〜来てほしいのは日本であったという調査の結果、…; a topic that gets its predicate, with no comma between, inside a clause という makes a noun's content, when a new topic on a noun follows the comma after that noun phrase, as in 食の大部分は家庭が担っているという実態を踏まえれば、食に関する指導は、…), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは. A は that makes an adverb of the noun before it (最後は, in the end; the words are in the topic-adverb word list) is not a topic; with a noun or の before it (交渉の最後は) it is. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. A topic that sets the time or the case (決定後は, 普及以前は) ends at 〜ますが or 〜でしたが when a subject of its own follows, even with another subject between. An article of a statute that a document of another kind quotes as it stands (第7条 …, the forms in the statute-article-opener word list) is not the writer's sentence and is not counted. Not used on English documents.
ja: 主題(名詞+は)の無い文、鉤括弧で引いたものの中、上限までの距離は見ません。主題の述語が先の節で閉じる文(「この計画は簡単ではありませんが、…」「〜であって、…」、後ろの節に別の主語がある「〜ではなく、」「〜であるため、」「〜の想定のため、」(後ろが話し手の頼み(〜していただけると、〜いただきたい)でもよい)「〜であり、」(主題との間に別の主題(〜は)が無く、文末がまた繋辞か「〜がある」でないとき。主題が行いを名詞にしたもの(〜することは重要であり、…影響を及ぼす可能性があります)なら、後ろに別の主語があれば文末は何でもよい。後ろの主語は節を名詞にしたもの(〜することが求められている)でもよく、文末の名詞に「が」の主語が付くとき(〜を図ることが必要である)や、最後の読点の後に行いを名詞にした主語(〜を行うことも、〜を図ることが)があるときは繋辞で終わっても)、受け身の「〜され、」(受け身の主語が名詞(支部が置かれ)でなく、後ろに時を言うのではない名詞の新しい主題(〜の議論は)が立ち、主題との間に別の主題が無いとき)、繋辞の理由「〜ものですから、」「〜であるので、」(後ろに時を言うのではない名詞の新しい主題(私たちは)が立ち、主題との間に別の主題が無いとき)、読点を挟まない「〜は〜で、」「〜であるならば、」「〜にあるところ、」「〜ており、」、受け身で伝える引用「〜だと言われているが」、主題と「〜ますが、」「〜ましたが、」(打ち消しの「〜ませんが、」「〜ませんでしたが、」も)の間に別の主語が無く、その後ろが別の主語(〜が)の節を経て新しい主題(〜は、〜には)に移る文か、直後に名詞の新しい主題(〜ましたが、赤澤大臣は…、〜ておりますが、本事業は、…)が立って文末まで続く文、主題が行いを名詞にしたもの(〜することは差し控えますが、…)、主題からそこまでに別の主語が無い「〜ことから、」「〜つつ、」「〜としても、」「〜こととし、」、問いの「〜のか、」(語は語彙表 topic-clause-close)、述語の後ろに丸数字の番号(③)が来て一行に詰まった箇条の次の項目が始まるところ、「〜のは」の主題が「という」で名詞に掛かる節の中で繋辞の述語を得て、その名詞句が読点で終わるところ(〜来てほしいのは日本であったという調査の結果、…)、主題が読点を挟まずに「〜という〜」の節の中で述語を得て、その名詞句の後の読点の後ろに名詞の新しい主題が立つところ(食の大部分は家庭が担っているという実態を踏まえれば、食に関する指導は、…))は、その節の終わりまでを数えます。後ろの節の主語には「〜のほとんどは」も、「〜については」「〜に関しては」(語は語彙表 topic-phrase-particle)も数えます。副詞になる「は」(最後は=結局のところ。語は語彙表 topic-adverb)は主題と読みません。前に名詞や「の」が付けば(交渉の最後は)主題です。時や場面を言う「は」(今夜は、当日は、〜ときは)の後ろに別の主題があれば、その主題から数えます。時や場面を言う主題(決定後は、普及以前は)は、「〜ますが、」「〜でしたが、」の後ろに別の主語があれば、間に別の主語があってもそこまでを数えます。法令でも契約でもない文書が条文をそのまま載せた文(「第7条 …」、形は語彙表 statute-article-opener)は、書き手が直せる文ではないので数えません。英語の文書には使いません。
en: Sentences with no topic (noun + は), quotations in 「」, and distances up to the limit are not counted. When the topic gets its own predicate in an earlier clause (〜ではありませんが, 〜であって; 〜ではなく, 〜であるため, 〜の想定のため (or followed by the speaker asking a favour, as in 〜していただけると, 〜いただきたい), 〜であり (when no other topic stands between and the sentence does not end on a copula or 〜がある again, or ends on anything when the topic is an act made a noun and a subject of its own follows (〜することは重要であり、…影響を及ぼす可能性があります); the later subject may be a clause made a noun, 〜することが求められている, and when the final noun has a subject of its own with が, 〜を図ることが必要である, or an act made a noun with が or も follows the last comma, 〜を行うことも重要な役割である, the sentence may end on a copula), a passive 〜され whose own subject is not a noun (支部が置かれ), followed by a new topic on a noun that does not set the time (〜の議論は) with no other topic between, a copula's reason 〜ものですから or 〜であるので followed by a new topic on a noun that does not set the time (私たちは) with no other topic between, 〜は〜で with no comma between, 〜であるならば, 〜にあるところ or 〜ており followed by a clause with its own subject; a passive report 〜だと言われているが; 〜ますが or 〜ましたが (or the negative 〜ませんが, 〜ませんでしたが) with no other subject between the topic and it, followed by a clause with a subject of its own (〜が) and then a new topic (〜は, 〜には), or straight away by a noun as a new topic that runs to the end (〜ましたが、赤澤大臣は…, 〜ておりますが、本事業は、…), or always when the topic is an act made a noun (〜することは差し控えますが、…); 〜ことから, 〜つつ, 〜としても, 〜こととし or a question's 〜のか with no other subject between the topic and it, from the topic-clause-close word list; a circled number (③) after a predicate, where a list run into one line starts its next item; a 〜のは topic that gets its copula inside a clause という makes a noun's content, when that noun phrase ends at a comma, as in 〜来てほしいのは日本であったという調査の結果、…; a topic that gets its predicate, with no comma between, inside a clause という makes a noun's content, when a new topic on a noun follows the comma after that noun phrase, as in 食の大部分は家庭が担っているという実態を踏まえれば、食に関する指導は、…), the count stops at that clause's end. A later clause's subject may be a part, as in 〜のほとんどは, or stand on a compound particle, as in 〜については and 〜に関しては (the topic-phrase-particle word list). A は that makes an adverb of the noun before it (最後は, in the end; the words are in the topic-adverb word list) is not a topic; with a noun or の before it (交渉の最後は) it is. When a は that sets the time or the case (今夜は, 当日は, 〜ときは) is followed by another topic, the count starts from that topic. A topic that sets the time or the case (決定後は, 普及以前は) ends at 〜ますが or 〜でしたが when a subject of its own follows, even with another subject between. An article of a statute that a document of another kind quotes as it stands (第7条 …, the forms in the statute-article-opener word list) is not the writer's sentence and is not counted. Not used on English documents.
level_meaning:
ja: 主題から述語まで {limit} 字まで
en: up to {limit} {limit|character|characters} between the topic and the predicate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { overLimit, ownTokens } from "./sentence-load.ts";
const CLOSER_LEXICON = "topic-clause-close";
const ARTICLE_LEXICON = "statute-article-opener";
const ADVERB_LEXICON = "topic-adverb";
const PHRASE_PARTICLE_LEXICON = "topic-phrase-particle";

/**
* Whether the sentence is an article of a statute quoted in another kind of document (第7条 … in a manual): the law's wording,
Expand All @@ -21,7 +22,7 @@ const quotesArticle = (doc: ProseDocument, genre: string | undefined): ((sentenc
/** The distance from the sentence's topic (〜は) to the end, where its predicate is. Needs the language's tokens. */
export const topicPredicateDistance: Detector = (doc, options) => {
const patterns = (lexicon: string): string[] => (doc.lexicons[lexicon] ?? []).map((entry) => entry.pattern);
const words: TopicClauseWords = { closers: patterns(CLOSER_LEXICON), adverbs: patterns(ADVERB_LEXICON) };
const words: TopicClauseWords = { closers: patterns(CLOSER_LEXICON), adverbs: patterns(ADVERB_LEXICON), phraseParticles: patterns(PHRASE_PARTICLE_LEXICON) };
const quoted = quotesArticle(doc, options.genre);
return overLimit((sentence) => (sentence.tokens === undefined || quoted(sentence) ? undefined : topicDistance(ownTokens(sentence), words)))(doc, options);
};
Loading
Loading