Merge remote-tracking branch 'hyphenate/master'
commit
8eedb97bb6
@ -0,0 +1,43 @@
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: "Build using Racket '${{ matrix.racket-version }}' (${{ matrix.racket-variant }})"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
racket-version: ["6.6", "6.7", "6.8", "6.9", "6.10.1", "6.11", "6.12", "7.0", "7.1", "7.2", "7.3", "7.4", "7.5", "7.6", "7.7", "7.8", "7.9", "current"]
|
||||
racket-variant: ["BC", "CS"]
|
||||
# CS builds are only provided for versions 7.4 and up so avoid
|
||||
# running the job for prior versions.
|
||||
exclude:
|
||||
- {racket-version: "6.6", racket-variant: "CS"}
|
||||
- {racket-version: "6.7", racket-variant: "CS"}
|
||||
- {racket-version: "6.8", racket-variant: "CS"}
|
||||
- {racket-version: "6.9", racket-variant: "CS"}
|
||||
- {racket-version: "6.10.1", racket-variant: "CS"}
|
||||
- {racket-version: "6.11", racket-variant: "CS"}
|
||||
- {racket-version: "6.12", racket-variant: "CS"}
|
||||
- {racket-version: "7.0", racket-variant: "CS"}
|
||||
- {racket-version: "7.1", racket-variant: "CS"}
|
||||
- {racket-version: "7.2", racket-variant: "CS"}
|
||||
- {racket-version: "7.3", racket-variant: "CS"}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- uses: Bogdanp/setup-racket@v0.11
|
||||
with:
|
||||
distribution: 'full'
|
||||
version: ${{ matrix.racket-version }}
|
||||
variant: ${{ matrix.racket-variant }}
|
||||
|
||||
- name: Install hyphenate and its dependencies
|
||||
run: raco pkg install --auto --batch
|
||||
|
||||
- name: Run the tests
|
||||
run: xvfb-run raco test -j 4 -p hyphenate
|
@ -0,0 +1,18 @@
|
||||
# for Racket
|
||||
compiled/
|
||||
|
||||
# for Mac OS X
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear on external disk
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
hyphenate/scribblings/hyphenate.html
|
||||
hyphenate/scribblings/*.css
|
||||
hyphenate/scribblings/*.js
|
@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
@ -0,0 +1,3 @@
|
||||
Hyphenate
|
||||
© 2014-2016 Matthew Butterick
|
||||
Licensed under the LGPL (see "LGPL.txt")
|
@ -0,0 +1,2 @@
|
||||
#lang s-exp "private/bootstrap.rkt"
|
||||
fr
|
@ -0,0 +1 @@
|
||||
#lang hyphenate/private/exception-prep
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
||||
#lang info
|
||||
(define scribblings '(("scribblings/hyphenate.scrbl" ())))
|
||||
(define compile-omit-paths '("tests.rkt"))
|
||||
(define post-install-collection "post-installer.rkt")
|
@ -0,0 +1,7 @@
|
||||
#lang racket
|
||||
(require "us.rkt")
|
||||
(provide (all-from-out "us.rkt"))
|
||||
|
||||
(module+ safe
|
||||
(require (submod "us.rkt" safe))
|
||||
(provide (all-from-out (submod "us.rkt" safe))))
|
@ -0,0 +1,8 @@
|
||||
#lang racket/base
|
||||
(provide (all-defined-out))
|
||||
|
||||
(define (post-installer home-dir)
|
||||
(for ([mod '(hyphenate/us hyphenate/fr)])
|
||||
(displayln (format "running post-installer in ~a" mod))
|
||||
(define proc (dynamic-require mod 'post-installer))
|
||||
(proc home-dir)))
|
@ -0,0 +1,85 @@
|
||||
#lang racket/base
|
||||
(require (for-syntax racket/base syntax/strip-context)
|
||||
txexpr/base
|
||||
sugar/define
|
||||
racket/contract
|
||||
racket/file
|
||||
racket/fasl
|
||||
(only-in xml xexpr/c)
|
||||
(prefix-in core: hyphenate/private/core))
|
||||
|
||||
(provide (rename-out [mb #%module-begin]) #%top-interaction #%top #%datum #%app)
|
||||
|
||||
;; An exception-word is a string of word characters or hyphens.
|
||||
(define (exception-word? x)
|
||||
(and (string? x) (regexp-match #px"^(\\p{L}|-)+$" x) #t))
|
||||
(define (exception-words? xs)
|
||||
(and (list? xs) (andmap exception-word? xs)))
|
||||
|
||||
(define hyphenate/c
|
||||
((xexpr?) ((or/c char? string?)
|
||||
#:exceptions exception-words?
|
||||
#:min-length (or/c integer? #f)
|
||||
#:omit-word (string? . -> . any/c)
|
||||
#:omit-string (string? . -> . any/c)
|
||||
#:omit-txexpr (txexpr? . -> . any/c)
|
||||
#:min-left-length (or/c (and/c integer? positive?) #f)
|
||||
#:min-right-length (or/c (and/c integer? positive?) #f)
|
||||
#:min-hyphens (and/c integer? positive?)) . ->* . xexpr/c))
|
||||
|
||||
(define (make-hyphenate-function patterns exceptions)
|
||||
(make-keyword-procedure
|
||||
;; put caches here so they can persist across successive invocations of the function.
|
||||
;; but remain distinct between instantiations of this module (say, us vs fr)
|
||||
;; pass them as arguments to the core:hyphenate func
|
||||
(let ([word-cache exceptions] ; preload exceptions
|
||||
[pattern-cache patterns])
|
||||
(λ (kws kw-args . rest)
|
||||
(keyword-apply core:hyphenate kws kw-args word-cache pattern-cache rest)))))
|
||||
|
||||
(define (make-unhyphenate-function)
|
||||
(make-keyword-procedure
|
||||
(λ (kws kw-args . rest)
|
||||
(keyword-apply core:unhyphenate kws kw-args rest))))
|
||||
|
||||
(define unhyphenate/c
|
||||
((xexpr/c) ((or/c char? string?)
|
||||
#:omit-word (string? . -> . any/c)
|
||||
#:omit-string (string? . -> . any/c)
|
||||
#:omit-txexpr (txexpr? . -> . any/c)) . ->* . xexpr/c))
|
||||
|
||||
(define (load-from-cache-if-possible module-path cache-path id-sym)
|
||||
(unless (and (file-exists? cache-path)
|
||||
(> (file-or-directory-modify-seconds cache-path)
|
||||
(file-or-directory-modify-seconds module-path)))
|
||||
(with-output-to-file cache-path
|
||||
(λ () (s-exp->fasl (dynamic-require module-path id-sym) (current-output-port)))
|
||||
#:exists 'replace))
|
||||
(with-input-from-file cache-path
|
||||
(λ () (fasl->s-exp (current-input-port)))))
|
||||
|
||||
(define-syntax (mb stx)
|
||||
(syntax-case stx ()
|
||||
[(_ DIR)
|
||||
(let* ([base (let-values ([(base name _) (split-path (syntax-source stx))])
|
||||
base)]
|
||||
[dir (build-path base (symbol->string (syntax->datum #'DIR)))])
|
||||
(with-syntax ([PATTERNS-PATH (build-path dir "patterns.rkt")]
|
||||
[PATTERN-CACHE-PATH (build-path dir "compiled" "patterns-cache.rktd")]
|
||||
[EXCEPTIONS-PATH (build-path dir "exceptions.rkt")]
|
||||
[EXCEPTIONS-CACHE-PATH (build-path dir "compiled" "exceptions-cache.rktd")]
|
||||
[PATTERNS-ID 'patterns]
|
||||
[EXCEPTIONS-ID 'exceptions])
|
||||
#'(#%module-begin
|
||||
(define PATTERNS-ID (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID))
|
||||
;; a file-cached hash is immutable, so convert it
|
||||
(define EXCEPTIONS-ID (make-hash (hash->list (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID))))
|
||||
(define+provide (post-installer home-dir)
|
||||
(load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID)
|
||||
(load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID))
|
||||
(define+provide+safe hyphenate
|
||||
hyphenate/c
|
||||
(make-hyphenate-function PATTERNS-ID EXCEPTIONS-ID))
|
||||
(define+provide+safe unhyphenate
|
||||
unhyphenate/c
|
||||
(make-unhyphenate-function)))))]))
|
@ -0,0 +1,21 @@
|
||||
#lang racket/base
|
||||
(require racket/string racket/list hyphenate/private/core)
|
||||
(provide (rename-out [emb #%module-begin]) #%app #%datum #%top-interaction)
|
||||
|
||||
(define-syntax-rule (emb STRS)
|
||||
(#%module-begin
|
||||
(provide exceptions)
|
||||
(define exceptions (for/hash ([str (in-list (list . STRS))])
|
||||
(define key+val (exception-word->word+pattern str))
|
||||
(values (first key+val) (second key+val))))
|
||||
(module+ main exceptions)))
|
||||
|
||||
(module+ reader
|
||||
(require racket/port)
|
||||
(provide (rename-out [exception-prep-read-syntax read-syntax]))
|
||||
|
||||
(define (exception-prep-read-syntax src in)
|
||||
(with-syntax ([STRS (string-split (port->string in))])
|
||||
(syntax->datum
|
||||
#'(module exception-prep hyphenate/private/exception-prep
|
||||
STRS)))))
|
@ -0,0 +1,21 @@
|
||||
#lang racket/base
|
||||
(require hyphenate/private/core racket/list racket/file)
|
||||
(provide (rename-out [pmb #%module-begin]) #%app #%datum #%top-interaction)
|
||||
|
||||
(define-syntax-rule (pmb STRS)
|
||||
(#%module-begin
|
||||
(provide patterns)
|
||||
(define patterns (for/hasheq ([str (in-list (list . STRS))])
|
||||
(define key+val (string->hashpair str))
|
||||
(values (string->symbol (first key+val)) (second key+val))))
|
||||
(module+ main patterns)))
|
||||
|
||||
(module+ reader
|
||||
(provide read-syntax)
|
||||
(define (read-syntax src in)
|
||||
(with-syntax ([STRS (for/list ([line (in-lines in)]
|
||||
#:when (and (positive? (string-length line)) ; omit empty
|
||||
(not (regexp-match #rx"^;" line)))) ; omit comments
|
||||
line)])
|
||||
(syntax->datum #'(module patterns hyphenate/private/pattern-prep
|
||||
STRS)))))
|
@ -0,0 +1,88 @@
|
||||
#lang racket/base
|
||||
(require (submod hyphenate safe) txexpr/base rackunit)
|
||||
|
||||
(define omit-em-tag (λ (x) (member (car x) '(em))))
|
||||
(define omit-p-tag (λ (x) (member (car x) '(p))))
|
||||
(define omit-foo-zam-tag (λ (x) (member (car x) '(foo zam))))
|
||||
(define ends-with-s (λ (x) (regexp-match #rx"s$" x)))
|
||||
(define omit-script-tag (λ (x) (member (car x) '(script))))
|
||||
(define tx-with-attr (λ (x) (with-handlers ([exn:fail? (λ (exn) #f)])
|
||||
(equal? (attr-ref x 'hyphens) "no-thanks"))))
|
||||
|
||||
(check-equal? (hyphenate "edges") "edges") ;; word without matching patterns
|
||||
(check-equal? (hyphenate "polymorphism") "poly\u00ADmor\u00ADphism")
|
||||
(check-equal? (hyphenate "polymorphism" #:min-hyphens 1) "poly\u00ADmor\u00ADphism")
|
||||
(check-equal? (hyphenate "polymorphism" #:min-hyphens 2) "poly\u00ADmor\u00ADphism")
|
||||
(check-equal? (hyphenate "polymorphism" #:min-hyphens 3) "polymorphism")
|
||||
(check-equal? (hyphenate "polymorphism" #:min-hyphens 42) "polymorphism")
|
||||
(check-equal? (hyphenate "POLYmorPHISM") "POLY\u00ADmor\u00ADPHISM")
|
||||
(check-equal? (hyphenate "polymorphism" #:min-length 100) "polymorphism")
|
||||
(check-equal? (hyphenate "ugly" #:min-length 1) "ug\u00ADly")
|
||||
(check-equal? (hyphenate "ugly" #:min-length 1 #:min-hyphens 2) "ugly")
|
||||
(check-equal? (unhyphenate "poly\u00ADmor\u00ADphism") "polymorphism")
|
||||
(check-equal? (hyphenate "polymorphism" #\-) "poly-mor-phism")
|
||||
(check-equal? (hyphenate "compotumi" #\-) "com-po-tu-mi")
|
||||
(check-equal? (hyphenate "CompOtumi" #\-) "Comp-Otu-mi")
|
||||
(check-equal? (hyphenate "polymorphism" "foo") "polyfoomorfoophism")
|
||||
(check-equal? (unhyphenate "polyfoomorfoophism" "foo") "polymorphism")
|
||||
(check-equal? (hyphenate "circular polymorphism squandering") "cir\u00ADcu\u00ADlar poly\u00ADmor\u00ADphism squan\u00ADder\u00ADing")
|
||||
(check-equal? (hyphenate "circular polymorphism squandering" #:min-hyphens 2) "cir\u00ADcu\u00ADlar poly\u00ADmor\u00ADphism squan\u00ADder\u00ADing")
|
||||
(check-equal? (hyphenate "circular polymorphism squandering" #:min-hyphens 3) "circular polymorphism squandering")
|
||||
(check-equal? (hyphenate '(p "circular polymorphism" amp (em "squandering"))) '(p "cir\u00ADcu\u00ADlar poly\u00ADmor\u00ADphism" amp (em "squan\u00ADder\u00ADing")))
|
||||
(check-equal? (hyphenate "present project") "present project") ; exception words
|
||||
;; test these last so exceptions have been set up already
|
||||
|
||||
;(check-equal? (word->hyphenation-points "polymorphism") '("poly" "mor" "phism"))
|
||||
;(check-equal? (word->hyphenation-points "present") '("present")) ; exception word
|
||||
|
||||
;(check-true (exception-word? "Foobar"))
|
||||
;(check-true (exception-word? "foobar"))
|
||||
;(check-false (exception-word? "foobar!"))
|
||||
;(check-true (exception-word? "foo-bar"))
|
||||
;(check-false (exception-word? "foo bar"))
|
||||
|
||||
;; omit certain tags
|
||||
(check-equal? (hyphenate '(p "circular polymorphism" amp (em "squandering")) #:omit-txexpr omit-em-tag)
|
||||
'(p "cir\u00ADcu\u00ADlar poly\u00ADmor\u00ADphism" amp (em "squandering")))
|
||||
|
||||
(check-equal? (hyphenate '(p "circular polymorphism" amp (em "squandering")) #:omit-txexpr omit-p-tag)
|
||||
'(p "circular polymorphism" amp (em "squandering")))
|
||||
|
||||
(check-equal? (hyphenate '(p (foo "circular") (bar "circular") (zam "circular")) #:omit-txexpr omit-foo-zam-tag)
|
||||
'(p (foo "circular") (bar "cir\u00ADcu\u00ADlar") (zam "circular")))
|
||||
|
||||
; omit txexprs with an attribute
|
||||
(check-equal? (hyphenate '(p (foo ((hyphens "no-thanks")) "circular") (foo "circular"))
|
||||
#:omit-txexpr tx-with-attr)
|
||||
'(p (foo ((hyphens "no-thanks")) "circular") (foo "cir\u00ADcu\u00ADlar")))
|
||||
|
||||
|
||||
;; omit strings that end with "s"
|
||||
#;(check-equal? (hyphenate '(p (foo "curses tailfeathers") (foo "curses tailfeather")) #:omit-string ends-with-s)
|
||||
'(p (foo "curses tailfeathers") (foo "curs\u00ADes tail\u00ADfeath\u00ADer")))
|
||||
|
||||
;; omit words that end with "s"
|
||||
#;(check-equal? (hyphenate '(p (foo "curses tailfeathers") (foo "curses tailfeather")) #:omit-word ends-with-s)
|
||||
'(p (foo "curses tailfeathers") (foo "curses tail\u00ADfeath\u00ADer")))
|
||||
|
||||
|
||||
(check-equal? (unhyphenate '(p (script "tail-feathers") (em "tail-feathers")) #\- #:omit-txexpr omit-script-tag)
|
||||
'(p (script "tail-feathers") (em "tailfeathers")))
|
||||
|
||||
(check-equal? (unhyphenate '(p "cir-cu-lar poly-mor-phism" "cir-cu-lar poly-mor-phisms") #\- #:omit-string ends-with-s)
|
||||
'(p "circular polymorphism" "cir-cu-lar poly-mor-phisms"))
|
||||
|
||||
(check-equal? (hyphenate "polymorphism" #\- #:min-left-length 5 #:min-right-length 5) "polymor-phism")
|
||||
(check-equal? (hyphenate "polymorphism" #\- #:min-left-length 3 #:min-right-length 7) "poly-morphism")
|
||||
(check-equal? (hyphenate "polymorphism" #\- #:min-left-length 7 #:min-right-length 7) "polymorphism")
|
||||
(check-equal? (hyphenate "polymorphism" #\* #:exceptions '("polymo-rphism")) "polymo*rphism")
|
||||
(check-equal? (hyphenate "polymorphism" #\* #:exceptions '("polymo-rphism")) "polymo*rphism")
|
||||
(check-equal? (hyphenate "polymorphism" #\-) "poly-mor-phism") ; exceptions are temporary
|
||||
|
||||
(check-equal? (hyphenate "formidable" #\-) "for-mi-da-ble")
|
||||
|
||||
(module french racket/base
|
||||
(require (submod hyphenate/fr safe) rackunit)
|
||||
(check-equal? (hyphenate "formidable" #\-) "for-mi-dable")) ; hyphenates differently in French
|
||||
|
||||
(require 'french)
|
@ -0,0 +1,2 @@
|
||||
#lang s-exp "private/bootstrap.rkt"
|
||||
us
|
@ -0,0 +1,26 @@
|
||||
#lang hyphenate/private/exception-prep
|
||||
arc-min-ute
|
||||
as-so-ciate
|
||||
as-so-ciates
|
||||
dec-li-na-tion
|
||||
dis-tri-bu-tion
|
||||
law-yer
|
||||
law-yer-ing
|
||||
law-yer-ly
|
||||
law-yered
|
||||
law-yers
|
||||
oblig-a-tory
|
||||
oki-na
|
||||
oki-nas
|
||||
phil-an-thropic
|
||||
present
|
||||
presents
|
||||
project
|
||||
projects
|
||||
re-ci-pro-ci-ty
|
||||
re-cog-ni-zance
|
||||
real-ly
|
||||
ref-or-ma-tion
|
||||
ret-ri-bu-tion
|
||||
ta-ble
|
||||
ty-pog-ra-pher
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,6 @@
|
||||
#lang info
|
||||
(define version "0.2")
|
||||
(define collection 'multi)
|
||||
(define deps '("base" ["sugar" #:version "0.2"] ["txexpr" #:version "0.2"]))
|
||||
(define update-implies '("txexpr" "sugar"))
|
||||
(define build-deps '("scribble-lib" "racket-doc" "rackunit-lib"))
|
Loading…
Reference in New Issue