Add java.text.BreakIterator (#1817)
This commit is contained in:
parent
57b799e63d
commit
238a98d9b2
4 changed files with 25 additions and 2 deletions
|
|
@ -9,10 +9,12 @@ A preview of the next release can be installed from
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
- [#1815](https://github.com/babashka/babashka/issues/1815): Make install-script wget-compatible
|
- Add `java.text.BreakIterator`
|
||||||
- Bump `fs` to `0.5.25`
|
- Bump `fs` to `0.5.25`
|
||||||
- Bump `jsoup` to `1.20.1`
|
- Bump `jsoup` to `1.20.1`
|
||||||
- Bump `edamame` to `1.4.30`
|
- Bump `edamame` to `1.4.30`
|
||||||
|
- [#1815](https://github.com/babashka/babashka/issues/1815): Make install-script wget-compatible ([@eval](https://github.com/eval))
|
||||||
|
|
||||||
|
|
||||||
## 1.12.200 (2025-04-26)
|
## 1.12.200 (2025-04-26)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,9 @@
|
||||||
org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory"
|
org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory"
|
||||||
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}
|
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}
|
||||||
com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox"
|
com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox"
|
||||||
:git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}}
|
:git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}
|
||||||
|
net.sekao/odoyle-rules {:git/url "https://github.com/oakes/odoyle-rules"
|
||||||
|
:git/sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"}}
|
||||||
:classpath-overrides {org.clojure/clojure nil
|
:classpath-overrides {org.clojure/clojure nil
|
||||||
org.clojure/spec.alpha nil}}
|
org.clojure/spec.alpha nil}}
|
||||||
:clj-nvd
|
:clj-nvd
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,7 @@
|
||||||
java.text.ParsePosition
|
java.text.ParsePosition
|
||||||
;; adds about 200kb, same functionality provided by java.time:
|
;; adds about 200kb, same functionality provided by java.time:
|
||||||
java.text.SimpleDateFormat
|
java.text.SimpleDateFormat
|
||||||
|
java.text.BreakIterator
|
||||||
~@(when features/java-time?
|
~@(when features/java-time?
|
||||||
`[java.time.format.DateTimeFormatter
|
`[java.time.format.DateTimeFormatter
|
||||||
java.time.Clock
|
java.time.Clock
|
||||||
|
|
@ -824,6 +825,8 @@
|
||||||
(and thread-builder
|
(and thread-builder
|
||||||
(instance? thread-builder v))
|
(instance? thread-builder v))
|
||||||
thread-builder
|
thread-builder
|
||||||
|
(instance? java.text.BreakIterator v)
|
||||||
|
java.text.BreakIterator
|
||||||
;; keep commas for merge friendliness
|
;; keep commas for merge friendliness
|
||||||
,)]
|
,)]
|
||||||
;; (prn :res res)
|
;; (prn :res res)
|
||||||
|
|
|
||||||
|
|
@ -250,3 +250,19 @@
|
||||||
(is (nil? (bb nil "(import '(java.util.concurrent Executors ExecutorService))
|
(is (nil? (bb nil "(import '(java.util.concurrent Executors ExecutorService))
|
||||||
(let [fut (.submit ^ExecutorService (Executors/newCachedThreadPool) ^Runnable (fn [] 3))]
|
(let [fut (.submit ^ExecutorService (Executors/newCachedThreadPool) ^Runnable (fn [] 3))]
|
||||||
(.get fut))"))))
|
(.get fut))"))))
|
||||||
|
|
||||||
|
(deftest break-iterator-test
|
||||||
|
(is (= 1 (bb nil "(ns dude
|
||||||
|
(:import [java.text BreakIterator]))
|
||||||
|
|
||||||
|
(defn count-characters
|
||||||
|
[^String text]
|
||||||
|
(let [it (BreakIterator/getCharacterInstance)]
|
||||||
|
(.setText it text)
|
||||||
|
(loop [count 0]
|
||||||
|
(if (= (.next it) BreakIterator/DONE)
|
||||||
|
count
|
||||||
|
(recur (inc count))))))
|
||||||
|
|
||||||
|
(prn
|
||||||
|
(count-characters \"🇨🇦\"))"))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue