currently trend_phrasing
only takes 1 argument
headline(
...,
trend_phrases = trend_terms(more = "increase", less = "decrease")
)
while plural_phrasing
can take a list
headline(
30, 20,
...,
trend_phrases = trend_terms(more = "more", less = "less"),
plural_phrases = list(
employees = plural_phrasing(single = "employee", multi = "employees"),
applicants = plural_phrasing(single = "applicant", multi = "applicants"),
)
)
you can then call the headline
"We hired {delta} new {employees} ({delta_p}% {trend} {people} than last year)"
#> We hired 10 new employees (50% more applicants than last year)
How should multiple trend terms be incorporated?
You can technically pass it vectors like this with brackets ({trend[1]}
) but not sure it's intuitive and it's more of a side-effect rather than a feature
headline(
30, 20,
headline =
"We had {article_trend[1]} of {delta} {people[1]} ({delta_p}% {trend[2]} {people[2]} than last year)",
trend_phrases =
trend_terms(
more = c("increase", "more"),
less = c("decrease", "less")
),
plural_phrases =
list(
people = plural_phrasing(
single = c("employee", "applicant"),
multi = c("employees", "applicants")
)
)
)
#> We had an increase of 5 people.
#> That is 5 more employees than the same time last year (35 vs. 30).
should it be a list like plural_phrases
?
headline(
...,
trend_phrases = list(
increase = trend_terms(more = "increase", less = "decrease"
more = trend_terms(more = "more", less = "less")
),
plural_phrases = list(
people = plural_phrasing(single = "person", multi = "people"),
employees = plural_phrasing(single = "employee", multi = "employees")
)
)
For the most part, the name of the object is the same as one of the arguments. Should it be reduced to pairs with the word on the left being the name to call?
headline(
...,
trend_phrases = trend_terms(
c("increase", "decrease"),
c("more", "less")
),
plural_phrases = plural_phrasing(
c("person", "people"),
c("employee", "employees")
)
)
Or even shorter, a named vector, but not sure that makes any more sense:
headline(
...,
trend_phrases = trend_terms(
increase = "decrease",
more = "less"
),
plural_phrases = plural_phrasing(
person = "people",
employee = "employees"
)
)