-
Notifications
You must be signed in to change notification settings - Fork 907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude punctuation from character count for Japanese texts #22050
base: trunk
Are you sure you want to change the base?
Exclude punctuation from character count for Japanese texts #22050
Conversation
Pull Request Test Coverage Report for Build 2ab1e1bf0f27bcd8cc7abf73fce32659e2b76c93Details
💛 - Coveralls |
@@ -20,13 +20,14 @@ describe( "A TextLengthAssessment for a taxonomy page in Japanese", function() { | |||
expect( assessment._config.veryFarBelowMinimum ).toEqual( assessmentConfigJapanese.taxonomyAssessor.veryFarBelowMinimum ); | |||
} ); | |||
it( "should return a good result for taxonomy pages in Japanese when the text is 60 characters or more", function() { | |||
const paper = new Paper( "欧米では、かつては不吉の象徴とする迷信があり、魔女狩りなどによって黒猫が殺されることがあった。たとえばベルギー・ウェス。" ); | |||
const paper = new Paper( "欧米では、かつては不吉の象徴とする迷信があり、魔女狩りなどによって黒猫が殺されることがあった。その傾向は現在も続いており、" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since punctuation was removed from the count, the sentence length became less than 60 characters, so I added some more text, in order to trigger the same feedback from the assessment.
expect( sentences[ 1 ].sentenceLength ).toBe( 7 ); | ||
expect( sentences[ 2 ].sentenceLength ).toBe( 5 ); | ||
} ); | ||
it( "returns sentences with exclamation mark", function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was combined with the one above.
…xclude-punctuation-from-character-count-for-sentence-length-for-japanese
A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch. |
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
countCharacters.js
andwordsCharacterCount.js
. We use the latter in Keyphrase assessments, which filter out punctuation after the string has been segmented. We also use the helper for the Reading time feature.countCharacters.js
, which is used for the following assessments: Sentence length, Paragraph length, Subheading distribution, Text length.removePunctuation
helper incountCharacters.js
is because it doesn’t work for Japanese, as it requires a space before/ after a character in order to recognize it, and Japanese doesn't use spaces for the most part.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
「黒猫」(くろねこ、Black Cat)は、1843年に発表されたエドガー・アラン・ポーの短編小説。
文の長さ: いい感じです !
現在、全国の約130住宅が参加しており、そのほとんどが個人所有の民家です。日本の文化財建造物は、そのほとんどが『木造建築』で地震、台風、洪水など自然災害や火災の多い中で築後何百年と云う長い歴史を生き残って来たものです。更に戦争や社会構造などの変化で消えてしまった建造物も数多くあったことでしょう。昭和52年(1977)に当『全国重文民家の集い』が誕生して早や半世紀近く経とうとしています。 その間、国指定の重要文化財民家(略称: 重文民家)の所有者が手探りで学んで来た経験を互いに情報交換し、更に地域社会との更なる交流、行政や学識経験者との協力を深めて来ました。 構造物としての家屋の保存だけでなく、地域社会の文化やその家に伝わる伝統・住文化の継承に貢献。
段落の長さ: 長過ぎる段落はありません。Good Job!
又、近年では英国のH.H.A.(Historic Houses Association ―歴史住宅協会―)との交流を深め、英国を初め欧州の文化財情報や所有者の高齢化に伴う次世代への継承問題についての情報交換を行っている。 こんばんは~!お昼のブログもたくさん見ていただきありがとうございました:Dうーーー、今から90年代に戻れるなら「絶対に抜いたらあかんで!」って言いに行きたい💦 でも上に貼ってるブログ見たら、しみじみ眉毛で顔ってぜんぜん印象違うな…と思う!(NARSのチークでもおすすめ~!)美容つながりもうひとつ・・・。
小見出し分布: 小見出しは使用していませんが、テキストは十分に短く、おそらく必要ありません。
テキストの長さ: テキストは600 文字です。いいですね !
テキストの長さ: テキストは 599 文字です。これは推奨下限値 600 文字を少し下回ります。文章をもう少し加えましょう.
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo]
, added test instructions for Shopify and attached theShopify
label to this PR.Documentation
Quality assurance
Innovation
innovation
label.Fixes ##523