Skip to content

Commit

Permalink
Add TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
FAMarfuaty committed Jun 16, 2023
1 parent bbc5e3a commit 483b65b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ class KeyphraseDensityAssessment extends Assessment {

this._hasMorphologicalForms = researcher.getData( "morphology" ) !== false;

let text = paper.getText();
text = removeHtmlBlocks( text );
const text = paper.getText();
// eslint-disable-next-line no-warning-comments
// TODO: do we need to use the paper text, or can we adjust this to use the html parser?
this.setBoundaries( text, keyphraseLength, customGetWords );

this._keyphraseDensity = this._keyphraseDensity * keyphraseLengthFactor( keyphraseLength );
Expand Down Expand Up @@ -331,8 +332,9 @@ class KeyphraseDensityAssessment extends Assessment {
if ( customApplicabilityConfig ) {
this._config.applicableIfTextLongerThan = customApplicabilityConfig;
}
let text = paper.getText();
text = removeHtmlBlocks( text );
const text = paper.getText();
// eslint-disable-next-line no-warning-comments
// TODO: Adapt this to use HTML Parser.
const textLength = customCountLength ? customCountLength( text ) : getWords( text ).length;

return paper.hasText() && paper.hasKeyword() && textLength >= this._config.applicableIfTextLongerThan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import keyphraseLengthFactor from "./keyphraseLengthFactor.js";
* @returns {number} The recommended keyword count.
*/
export default function( text, keyphraseLength, recommendedKeywordDensity, maxOrMin, customGetWords ) {
// eslint-disable-next-line no-warning-comments
// TODO: adapt to use the HTML parser. Also for Japanese.
const wordCount = customGetWords ? customGetWords( text ).length : countWords( text );

if ( wordCount === 0 ) {
Expand Down

0 comments on commit 483b65b

Please sign in to comment.