Example

Financial Report Sentences

Financial statements from report prose.

Parse reported results, guidance, and balance information from financial-report sentences.

What it shows

  • FinancialStatement has ReportedResult, Guidance, and BalancePosition forms.
  • FinancialValue covers money, percentages, ranges, and approximate values.
  • Period recognises quarters, years, and relative periods such as NextYear.
  • MetricChange exposes direction, percentage, and an optional comparison basis.
  • CompanyName is assembled from reusable CapitalizedWord parts.

Try changing a reported result into guidance, adding a range, or changing a period from Q1 2026 to fiscal 2026.

Specs

spec.yml
$flags: [ 'CASE_INSENSITIVE', 'FLEXIBLE_WHITESPACE' ]

Number:
  Decimal: '\d+\.\d+'
  Integer: '\d+'

Currency:
  USD: 'USD'
  EUR: 'EUR'
  GBP: 'GBP'

Magnitude:
  Million: 'million'
  Billion: 'billion'

Metric:
  Revenue: 'revenue'
  NetIncome: 'net income'
  EBITDA: 'EBITDA'
  OperatingMargin: 'operating margin'
  CapitalExpenditure: 'capital expenditure'
  CashAndEquivalents: 'cash and equivalents'
  TotalDebt: 'total debt'

QuarterOrdinal:
  First: 'first'
  Second: 'second'
  Third: 'third'
  Fourth: 'fourth'

ChangeDirection:
  Increase: 'up'
  Decrease: 'down'

ComparisonBasis:
  YearOverYear: 'year over year'
  PriorYear: 'from the prior year'

Period:

  Quarter:
    $fields:
      quarterNumber: { $type: Number::Integer, $match: '[1-4]' }
      ordinal: QuarterOrdinal
      year: { $type: Number::Integer, $match: '\d{4}' }
    $patterns:
      - 'Q#{quarterNumber} #{year}'
      - 'the #{ordinal} quarter of #{year}'
      - 'the quarter'

  Year:
    $fields:
      year: { $type: Number::Integer, $match: '\d{4}' }
    $patterns: '(fiscal )?#{year}'
  NextYear: 'next year'

MetricChange:
  $fields:
    direction: ChangeDirection
    percent: FinancialValue::Percent
    basis: ComparisonBasis
  $patterns: '#{direction} #{percent}( #{basis})?'

FinancialValue:

  Percent:
    $fields:
      value: Number
    $patterns: '#{value}%'

  PercentRange:
    $fields:
      lower: Percent
      upper: Percent
    $patterns: '#{lower} to #{upper}'

  Money:
    $fields:
      currency: Currency
      amount: Number
      magnitude: Magnitude
    $patterns: '#{currency} #{amount}( #{magnitude})?'

  MoneyRange:
    $fields:
      lower: Money
      upper: Money
    $patterns: 'between #{lower} and #{upper}'

  Approximation:
    $fields:
      value: FinancialValue
    $patterns: 'approximately #{value}'

FinancialStatement:
  $types:
    CapitalizedWord: '[A-Z][A-Za-z]+'
    CompanyName: '${CapitalizedWord}( ${CapitalizedWord})*'

  ReportedResult:
    $fields:
      company: CompanyName
      metric: Metric
      value: FinancialValue
      period: Period
      change: MetricChange
    $patterns:
      - '#{company} reported #{metric} of #{value} for #{period}(, #{change})?'
      - '#{company} posted #{metric} of #{value} in #{period}(, #{change})?'

  Guidance:
    $fields:
      company: CompanyName
      metric: Metric
      value: FinancialValue
      period: Period
    $patterns:
      - '#{company} expects #{metric} #{value} for #{period}'
      - '#{company} forecast #{metric} of #{value} for #{period}'
      - '#{company} guided #{metric} to #{value} #{period}'

  BalancePosition:
    $fields:
      company: CompanyName
      period: Period
      metric: Metric
      value: FinancialValue
    $patterns:
      - '#{company} ended #{period} with #{metric} of #{value}'
      - '#{company} closed #{period} with #{metric} of #{value}'
Try it liveOpen Financial Report Sentences in StudioTweak the spec, paste your own input, and see the parse tree update in real time.

Or browse other examples →