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

forzagreen / n2words / 20760301385
99%
main: 97%

Build:
Build:
LAST BUILD BRANCH: feat/v4-esm-umd-bundles
DEFAULT BRANCH: main
Ran 06 Jan 2026 07:56PM UTC
Jobs 1
Files 63
Run time 1min
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

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 %.

3323 of 3354 new or added lines in 25 files covered. (99.08%)

2 existing lines in 2 files now uncovered.

9599 of 9679 relevant lines covered (99.17%)

131.54 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
97.76
-2.24% lib/languages/fr-BE.js
2
95.45
lib/classes/compound-scale-language.js
2
97.28
-2.72% lib/languages/ko.js
3
97.43
-2.57% lib/languages/nl.js
3
96.35
-3.65% lib/languages/sv.js
3
97.71
-2.29% lib/languages/zh-Hans.js
4
97.5
lib/classes/myriad-language.js
4
98.17
lib/classes/scale-language.js
4
97.25
-2.75% lib/languages/fr.js
5
95.13
-4.87% lib/languages/nb.js

Uncovered Existing Lines

Lines Coverage ∆ File
1
97.43
-2.57% lib/languages/nl.js
1
96.35
-3.65% lib/languages/sv.js
Jobs
ID Job ID Ran Files Coverage
1 20760301385.1 06 Jan 2026 07:56PM UTC 63
98.58
GitHub Action Run
Source Files on build 20760301385
  • 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 Repo
  • Github Actions Build #20760301385
  • 3520bcdc on github
  • Prev Build on main (#20684552856)
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