Commit Graph
2328 Commits
Author SHA1 Message Date
Skaywalker a47412aef9 proof: an AF count below 1 rejects the table, flags stay literal (#735) 2026-10-27 13:09:33 +01:00
Skaywalker 3051fab792 proof: .dic lines and alias numbers read as Hunspell reads them (#735)
Checked against the Hunspell 1.7 command line:
- Without a tab or a morphological field the whole line is the entry, so
  a phrase with single-byte flags (tök jó/396 in hu_HU) no longer fails
  the load or loses its alias; leading blanks belong to the entry.
- With an AF table a flag field is the alias its leading digits number
  (fal/2x is alias 2, lab/b has none); an undefined alias, in a .dic
  entry or a continuation class, reads as no flags instead of failing
  the dictionary; a table without its count line is ignored.
- A REP count line may carry a comment, like AF and ICONV.

normalize copies the input only from its first change on, and SET and
FLAG are found in one pass over the .aff.
2026-10-27 13:09:33 +01:00
Skaywalker 74449b87fb proof: read count comments, phrase entries and undefined aliases as Hunspell does (#735)
Checked against the Hunspell 1.7 command line:
- The first AF and ICONV line is the count even with a trailing comment
  (AF 2 # aliases), so alias numbers no longer shift and ICONV 1 # no
  longer turns 1 into #.
- A .dic entry ends where Hunspell ends it (dic_entry_end), so ad hoc/B
  is one entry and ad alone is no word.
- An undefined alias in a .dic entry reads as no flags: the stem loads
  without affixes instead of failing the whole dictionary.
- IGNORE characters are removed from the appended text only; a stripped
  text that holds one never matches a stem, as in Hunspell.
- FLAG UTF-8 and SET are found anywhere in the .aff, not only in the
  first 8 KB.

Also: normalize borrows the input when no conversion or ignored character
applies, the UTF-8 .aff reader counts fields as it goes and builds its
error context only on error, and the single-byte flag reader is
decode_latin1.
2026-10-27 13:09:33 +01:00
Skaywalker bb023684f2 proof: SUBSTANDARD stems are correct but never suggested, as with NOSUGGEST 2026-10-27 13:09:33 +01:00
Skaywalker 9b91b64d60 proof: test that unsupported directives are refused and morphology-only flags load
COMPOUNDFIRST and COMPOUNDLAST, the older names of COMPOUNDBEGIN and
COMPOUNDEND, are refused like them until compounding is supported.
2026-10-27 13:09:33 +01:00
Skaywalker efa570a9be proof: a one-flag field keeps its first byte, a directive reads only its first argument
Without FLAG UTF-8, Hunspell reads a field that names one flag (PFX/SFX,
KEEPCASE, FORBIDDENWORD and the like) through decode_flag, which takes its
first byte: SFX é is the flag 0xC3. Such a field no longer fails the load.
SYLLABLENUM lists flags and is read byte by byte like AF. SET and FLAG
read only their first argument, so FLAG UTF-8 with a trailing comment
keeps Unicode flags.
2026-10-27 13:09:33 +01:00
Skaywalker 7ebfcf0ee2 proof: .aff comments start after a directive's fields, .dic entries end where Hunspell ends them 2026-10-27 13:09:33 +01:00
Skaywalker 46a3067e20 proof: flag aliases, single-byte flags, ICONV, IGNORE and KEEPCASE in affix dictionaries (#735)
The Hungarian Hunspell dictionary declares SET UTF-8 but writes its flags as single bytes, uses AF aliases and 158 distinct flags. Read flag fields byte by byte unless FLAG UTF-8 is set, expand AF aliases, skip AM, apply ICONV and IGNORE, honour KEEPCASE, and widen flag masks to 256 bits. Compounding and NEEDAFFIX stay unsupported for now.
2026-10-27 13:09:33 +01:00
aiongg 2cf1d6c7ae Merge pull request #4489 from aiongg/layout
refactor: shared module layout (craft-contrib#20)
2026-10-26 21:32:09 -04:00
skylar taylor-barrick f54ea731cc Merge pull request #4487 from storytold/fix/nextest-0.9.150
ci: require nextest 0.9.150
2026-10-26 17:35:44 -06:00
aiongg 0404b4199a test: file_access scan stops only at inline test modules 2026-10-26 22:10:26 +00:00
aiongg 95ba3d07b4 docs: update paths of moved files 2026-10-26 21:16:49 +00:00
aiongg 835704f870 refactor(engine): move session::ime_state to the crate root as ime 2026-10-26 21:16:49 +00:00
aiongg 39336fe844 refactor(engine): move session::snapshot_types to the crate root as snapshot 2026-10-26 21:16:49 +00:00
aiongg 5a311f4615 refactor(engine): move session::prefs to the crate root as prefs 2026-10-26 21:16:49 +00:00
aiongg 8f1f3c6132 refactor(engine): move session::view to the crate root as view 2026-10-26 21:16:49 +00:00
aiongg e027a4244b refactor(engine): move session::doc_state to the crate root as doc_state 2026-10-26 21:16:49 +00:00
aiongg 3c4d7adc87 refactor(engine): move session::locale to the crate root as locale 2026-10-26 21:16:49 +00:00
aiongg cfa90220d9 refactor(engine): split session.rs into session/ 2026-10-26 21:16:49 +00:00
aiongg 8f10bd1b9f refactor(engine): split cmd/table.rs into table/ 2026-10-26 21:16:49 +00:00
aiongg a82063e50a refactor(engine): split cmd/insert.rs into insert/ 2026-10-26 21:16:49 +00:00
aiongg 342de16153 refactor(engine): split cmd/text.rs into text/ 2026-10-26 21:16:49 +00:00
aiongg d66f34b774 refactor(engine): split cmd/references.rs into references/ 2026-10-26 21:16:49 +00:00
aiongg 0a6c7605f6 refactor(engine): split cmd/para.rs into para/ 2026-10-26 21:16:49 +00:00
aiongg fbc95e1e10 refactor(engine): split cmd/citations.rs into citations/ 2026-10-26 21:16:49 +00:00
aiongg fac4b550c1 refactor(engine): split cmd/mailings.rs into mailings/ 2026-10-26 21:16:49 +00:00
aiongg cc728757f5 refactor(engine): split cmd/review.rs into review/ 2026-10-26 21:16:49 +00:00
aiongg 3d458a08b6 refactor(engine): split cmd/tools.rs into tools/ 2026-10-26 21:16:49 +00:00
aiongg dabc31eb83 refactor(engine): move cmd/tools tests to tools/tests.rs 2026-10-26 21:16:49 +00:00
aiongg 03f5df4bba refactor(engine): split cmd/objects.rs into objects/ 2026-10-26 21:16:49 +00:00
aiongg b8ddca30a1 refactor(docx): split read/chart.rs into read/chart/ 2026-10-26 21:16:49 +00:00
aiongg 80d8a9952a refactor(docx): split write/story.rs into write/story/ 2026-10-26 21:16:49 +00:00
aiongg 125fdc65ef refactor(docx): split read/story.rs into read/story/ 2026-10-26 21:16:49 +00:00
aiongg b1a94d4d4b refactor(docx): split write.rs into write/ 2026-10-26 21:16:49 +00:00
aiongg 0a4f5b8e84 refactor(docx): split read.rs into read/ 2026-10-26 21:16:49 +00:00
aiongg b8d3ec94b9 refactor(pdf): split exporter.rs into exporter/ 2026-10-26 21:16:49 +00:00
aiongg 7f3912c1df refactor(pdf): split lib.rs into modules 2026-10-26 21:16:49 +00:00
aiongg e1191cbb13 refactor(doc): split props.rs into props/ 2026-10-26 21:16:49 +00:00
aiongg 8348af42bd refactor(doc): split para.rs into para/ 2026-10-26 21:16:49 +00:00
aiongg 440d314f9c refactor(doc): split lib.rs into modules 2026-10-26 21:16:49 +00:00
aiongg 928e32fc12 refactor(doc): split review items out of lib.rs into review.rs 2026-10-26 21:16:49 +00:00
aiongg 3bc47b4cc0 refactor(formats): split sheet.rs into sheet/ 2026-10-26 21:16:49 +00:00
aiongg 2e61c73cb7 refactor(formats): split markdown.rs into markdown/ 2026-10-26 21:16:49 +00:00
aiongg 75bc3eb906 refactor(formats): split model.rs into model/ 2026-10-26 21:16:49 +00:00
aiongg 1bf2735604 refactor(formats): split html.rs into html/ 2026-10-26 21:16:49 +00:00
aiongg 59cec9d8bc refactor(formats): split odt.rs into odt/ 2026-10-26 21:16:49 +00:00
aiongg a209d1b268 refactor(formats): split rtf.rs into rtf/ 2026-10-26 21:16:49 +00:00
aiongg f0c66c81df refactor(formats): split latex.rs into latex/ 2026-10-26 21:16:49 +00:00
aiongg 0ad6f34c49 refactor(formats): move latex tests to latex/tests.rs 2026-10-26 21:16:49 +00:00
aiongg 6c21661c03 refactor(render): split lib.rs media code into media.rs 2026-10-26 21:16:49 +00:00