Skip to main content

Module entities

Module entities 

Source
Expand description

The attribution check of a report: a figure must stand next to the entity whose facts hold it.

super::figures asks whether a number is one of the facts. A report can still give a true number to the wrong entity: “Garden reached 31% of revenue” when 31% is the share of Electronics. Here the facts are grouped by entity (a store, a product category, a campaign), and every figure of a text is compared with the entity the text gives it to:

  • The text names an entity by its label or an alias, as a whole word, in any case, with any run of spaces between the words of the label. The longest label wins (“Garden Tools” before “Garden”), and a label is never read as figures (“Store 12”).
  • A figure is given to the entity named closest before it in its clause. When none is, a figure that opens its clause goes to the first entity named after it in the clause, any other to the entity named closest before it in its sentence, else the first one after it, else the entity the field is about (its scope). Clauses end at a comma or a semicolon followed by a space, a bracket, a dash between spaces and words such as “while”, “but”, “sedangkan”, never inside a label.
  • A group (“all categories”, “campaigns”) names no entity of its own: when a figure is given to a group, the entity the sentence names decides, else the scope when it holds the figure. A group with no facts allows any figure; a group with facts (the total of all campaigns) must hold it.
  • A figure is misattributed when some entities hold it and the one it is given to does not. A figure no entity holds is left to the numbers check, and a figure given to no entity is not judged. Small counts (3 stores, up to AttributionRules::integers_up_to) and years (1900 to 2100) written with digits alone are not judged: too many entities share them.

Figures are compared as the numbers check compares them (super::figures::NumberRules): rounding, percentages and ratios, notations.

Structs§

AttributionRules
How the attribution check judges figures.
Entities
The entities of a report and their facts.
Misattributed
A figure given to an entity whose facts do not hold it.