• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

forzagreen / n2words / 20760301385 / 1
99%
main: 97%

Build:
Build:
LAST BUILD BRANCH: dependabot/npm_and_yarn/dev-dependencies-14a4c99867
DEFAULT BRANCH: main
Ran 06 Jan 2026 07:56PM UTC
Files 63
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Jan 2026 04:12AM UTC coverage: 98.582% (-0.6%) from 99.16%
20760301385.1

push

github

web-flow
perf: add segment-based ScaleLanguage for 10x faster conversion (#205)

Replace GreedyScaleLanguage with a new segment-based architecture that uses
O(1) property lookups instead of O(n) array scans, achieving ~10x faster
number-to-words conversion.

## New Base Classes

- **ScaleLanguage**: Segment-based decomposition for most Western languages
  - O(1) vocabulary lookups using direct property access
  - Implicit one omission flags: omitOneBeforeHundred, omitOneBeforeThousand, omitOneBeforeScale
  - thousandWord property for languages that separate thousand from scale words

- **CompoundScaleLanguage**: Long scale with "thousand + previous" pattern
  - Pattern: million (10^6), thousand million (10^9), billion (10^12)
  - Used by: French, Portuguese, Spanish

- **MyriadLanguage**: 4-digit 万-based grouping for East Asian languages
  - Groups by 10,000 instead of 1,000
  - Used by: Japanese, Korean, Simplified Chinese, Traditional Chinese

## Languages Migrated (24 total)

ScaleLanguage: Amharic, Amharic Latin, Azerbaijani, Danish, Dutch, English,
Filipino, Finnish, German, Greek, Hausa, Indonesian, Malay, Norwegian Bokmål,
Swedish, Turkish

CompoundScaleLanguage: French, French Belgium, Portuguese, Spanish

MyriadLanguage: Japanese, Korean, Simplified Chinese, Traditional Chinese

## Removed

- GreedyScaleLanguage class (superseded by ScaleLanguage)
- TurkicLanguage class (merged into ScaleLanguage with omission flags)

## Other Changes

- Add groupByFours and placeValuesFour utilities for myriad mode
- Update add-language.js scaffolding to default to ScaleLanguage
- Store benchmark results in ~/.n2words-bench/ for persistence
- Support comma-separated language scopes in commitlint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

1456 of 1535 branches covered (94.85%)

Branch coverage included in aggregate %.

9599 of 9679 relevant lines covered (99.17%)

131.54 hits per line

Source Files on job 20760301385.1
  • Tree
  • List 63
  • Changed 22
  • Source Changed 22
  • Coverage Changed 22
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 20760301385
  • 3520bcdc on github
  • Prev Job for on v2 (#20684552856.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc