mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-07 12:13:20 +00:00
CP6.13: craft-libs#482/#485/#488 review — NOTICE carries the embedded Portuguese patterns' BSD notice; README: the usage example defines text, the eight-candidate limit, what the default build embeds; en_words writes under crates/proof
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FypgCX8LsYYE8fsj4byBm2
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5bd21c0509
commit
d2d5c737a6
@@ -25,6 +25,33 @@ crates/proof/data/en-words.dic: public domain, the words of the Moby Hyphenator
|
||||
Ward (Project Gutenberg eBook #3204), without its break points.
|
||||
crates/proof/data/en-extra.txt: MIT OR Apache-2.0, WordCraft contributors' own list of modern
|
||||
English words (a copy of craft-i18n's language-data/en-us/en-extra.txt).
|
||||
craft-proof Language data, embedded at build time from craft-i18n's language-data/ when
|
||||
CRAFT_I18N_DIR is set (CRAFT_PROOF_EMBED picks the locales; by default English and the German,
|
||||
Polish, Portuguese, Italian and Russian data). Each file keeps its licence header; the
|
||||
licences are listed in craft-i18n's ATTRIBUTION.md, and a pattern file's notice ships with any
|
||||
application that embeds it. The Portuguese hyphenation patterns (language-data/pt/
|
||||
hyphenation.pat, hyph-utf8 hyph-pt 1.4) are under the BSD 3-clause licence:
|
||||
Copyright (C) 1987, 1994, 1996, 2015 Pedro J. de Rezende, 1996, 2015 J. Joao Dias Almeida,
|
||||
2024 Leonardo Araujo and Aline Benevides.
|
||||
Redistribution and use in source and binary forms, with or without modification, are
|
||||
permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
* Neither the name of the University of Campinas, of the University of Minho nor the names of
|
||||
its contributors may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PEDRO J. DE REZENDE OR J.JOAO
|
||||
DIAS ALMEIDA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
crates/text/assets/hyphen/en-us.pat: CC0-1.0, trained from en-us.dic by DesignCraft's trainer.
|
||||
Hyphenation patterns for other languages, embedded through the hypher crate only when the
|
||||
matching craft-text feature is enabled (none are by default). They come from hyph-utf8,
|
||||
|
||||
@@ -82,8 +82,10 @@ craft-<name> = { git = "https://github.com/storytold/craft-libs", rev = "<commit
|
||||
- [`craft-print`](crates/print/README.md): PDF submission to CUPS and Windows, printer discovery,
|
||||
duplex/copies/colour and driver preferences. PDF generation stays in each app.
|
||||
- [`craft-proof`](crates/proof/README.md): proofing per language (spelling, suggestions, grammar,
|
||||
hyphenation, a Hunspell reader, user words). The word lists and patterns are craft-i18n's
|
||||
`language-data/`, embedded at build time from `CRAFT_I18N_DIR`.
|
||||
hyphenation, a Hunspell reader, user words, Language packs). The word lists and patterns are
|
||||
craft-i18n's `language-data/`, embedded at build time from `CRAFT_I18N_DIR`: English and the
|
||||
carry-over locales by default, the set `CRAFT_PROOF_EMBED` names otherwise (`en` for English
|
||||
only); other languages come from installed Language packs.
|
||||
|
||||
- [`craft-quit`](crates/quit/src/lib.rs): native macOS quit, egui close handling and an optional
|
||||
app menu. Unsaved-document decisions and save prompts stay in each app.
|
||||
|
||||
@@ -29,6 +29,7 @@ use craft_proof::{ProofLang, check_text_with, suggest_in, Options};
|
||||
use craft_proof::hyphen::{hyphen_points_in, Limits};
|
||||
|
||||
// A paragraph whose runs are in different languages (byte ranges of `text`).
|
||||
let text = "The colour of the hous.";
|
||||
let issues = check_text_with(text, &[(0..text.len(), ProofLang::EnGb)], &Options::default(), true, false);
|
||||
let fixes = suggest_in("colour", 5, ProofLang::En);
|
||||
let breaks = hyphen_points_in("hyphenation", &Limits::default(), ProofLang::En);
|
||||
@@ -166,8 +167,8 @@ English spelling uses the first of these that is there; `english_source(lang)` s
|
||||
4. **System Hunspell:** the English's own pair in the system locations. Never another English's:
|
||||
an `en_US` dictionary would mark British spellings, so en-GB and en-CA without their own use
|
||||
the built-in list, which has both spellings. Each name is looked for in every folder before the
|
||||
next name; a file that can't be read is skipped for the next name or folder; one file is read
|
||||
once for every English that uses it. `COMPOUNDRULE`, `ONLYINCOMPOUND` and `COMPOUNDMIN`
|
||||
next name; a file that can't be read is skipped for the next name or folder, up to the first eight
|
||||
candidates (the rest aren't tried); one file is read once for every English that uses it. `COMPOUNDRULE`, `ONLYINCOMPOUND` and `COMPOUNDMIN`
|
||||
(ordinals such as `21st`) are read; flag-based compounding (`COMPOUNDFLAG`…) is ignored for
|
||||
English rather than refused; `OCONV` writes suggestions as the dictionary says (`don’t`), as for
|
||||
every language. None on the web.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! README): every word of the public-domain Moby Hyphenator II list, without its break points.
|
||||
//!
|
||||
//! ```sh
|
||||
//! cargo run -p craft-proof --example en_words -- <craft-i18n>/language-data/en-us/en-us.dic data/en-words.dic
|
||||
//! cargo run -p craft-proof --example en_words -- <craft-i18n>/language-data/en-us/en-us.dic crates/proof/data/en-words.dic
|
||||
//! ```
|
||||
//!
|
||||
//! The input is craft-i18n's `en-us.dic`: the Moby Hyphenator II list by Grady Ward (Project
|
||||
|
||||
Reference in New Issue
Block a user