Yoast / YoastSEO.js

Analyze content on a page and give SEO feedback as well as render a snippet preview.
GNU General Public License v3.0
403 stars 170 forks source link

Create `keyphrases` tree research #2193

Closed atimmer closed 4 years ago

atimmer commented 5 years ago

Explanation

Create a keyphrases tree research that returns all the keywords in the ParsedPaper based on the Tree.

The keyphrases research should return Keyphrase objects. The Keyphrase object should contain:

Technical decisions

The KeyphraseResearch class should extend the Research class.

Given this input:

let input = Paragraph( "There is a time and place for everything. When I find these times and places, I am happy." );
let keyphrase = "time and place";

Expected output for a node:

let output = [
    {
        words: [
            Word( "time" ),
            Word( "and" ),
            Word( "place" )
        ],
        sentences: [
                    Sentence( "There is a time and place for everything." ),
                ],
                isSynonym: false,
        startIndex: 11,
        endIndex: 25
    },
    {
        words: [
            Word( "times" ),
            Word( "and" ),
            Word( "places" ),
        ],
        sentences: [
                    Sentence( "When I find these times and places, I am happy." ),
                ],
                isSynonym: false,
        startIndex: 60,
        endIndex: 76
    }
];

The indexes are relative to the containing text container. The objects are not new objects, but the objects that are already in the tree.

FAQ

Product questions

Notes

See https://github.com/Yoast/YoastSEO.js/issues/2078 for decisions

manuelaugustin commented 4 years ago

@atimmer & @nataliashitova will have a second look at the spec of this issue. The goal is to make sure that the output produced by this research fulfills the requirements of the assessments.

nataliashitova commented 4 years ago

This issue is closed in favor of https://github.com/Yoast/javascript/issues/428.