add_synonym: Add synonyms for object keywords

View source: R/add_keywords.r

add_synonymR Documentation

Add synonyms for object keywords

Description

The function allows to add synonyms for object keywords. Sometimes, objects of interest can be searched with different keywords on Google e.g., FC Bayern for Bayern Munich. Search scores for keywords that are added as synonyms are aggregated when running compute_score. The function allows to add synonyms for a single keyword at a time.

Usage

add_synonym(keyword, synonym)

## S3 method for class 'character'
add_synonym(keyword, synonym)

## S3 method for class 'list'
add_synonym(keyword, synonym)

Arguments

keyword

Keyword of type character and length 1 for which the synonyms are added.

synonym

Synonym of type character.

Value

Message that the synonym has been added successfully. Synonym data is written to table keyword_synonyms.

Note

To avoid trailing spaces stringr::str_squish is automatically applied to all keywords and synonyms.

See Also

  • compute_score()

  • stringr::str_squish()

Examples

## Not run: 
add_synonym(
  keyword = "fc bayern",
  synonym = "bayern munich"
)

## End(Not run)


ha-pu/doiGT documentation built on June 29, 2023, 9:14 a.m.