Compare commits
10 Commits
d15d9cf3e5
...
a93544a9c3
Author | SHA1 | Date |
---|---|---|
Eric Ihli | a93544a9c3 | 3 years ago |
Eric Ihli | d0cf546bf7 | 3 years ago |
Eric Ihli | 3385e7fd15 | 3 years ago |
Eric Ihli | 6164773515 | 3 years ago |
Eric Ihli | 9d547a2733 | 3 years ago |
Eric Ihli | e6481308cc | 4 years ago |
Eric Ihli | a44feaa166 | 4 years ago |
Eric Ihli | e4722dbb69 | 4 years ago |
Eric Ihli | d0f5ed1733 | 4 years ago |
Eric Ihli | 249919d684 | 4 years ago |
@ -1,24 +1,22 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [0.1.3] - 2021-05-02
|
||||||
### Changed
|
### Fixed
|
||||||
- Add a new arity to `make-widget-async` to provide a different widget shape.
|
- Fixed bug sylalbifying words that begin with consonants that don't adhere to sonority heirarchy.
|
||||||
|
- "Steel", for example. "T" is less sonorous than "S" and typically wouldn't be included in an onset, but since there are no vowels preceding the "ST" then both *should* be included in the onset.
|
||||||
## [0.1.1] - 2021-04-22
|
|
||||||
### Changed
|
|
||||||
- Documentation on how to make the widgets.
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
- `make-widget-sync` - we're all async, all the time.
|
|
||||||
|
|
||||||
|
## [0.1.2] - 2021-04-22
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed widget maker to keep working when daylight savings switches over.
|
- Fixed bug when getting phones from CMULexicon because the word wasn't found in the CMU dictionary. (Missing parens)
|
||||||
|
- Comment out warn-on-reflection code that was just being used to find performance gains.
|
||||||
|
|
||||||
## 0.1.0 - 2021-04-22
|
## 0.1.1
|
||||||
### Added
|
### Added
|
||||||
- Files from the new template.
|
|
||||||
- Widget maker public API - `make-widget-sync`.
|
|
||||||
|
|
||||||
[Unreleased]: https://github.com/com.owoga/phonetics/compare/0.1.1...HEAD
|
Initial release
|
||||||
[0.1.1]: https://github.com/com.owoga/phonetics/compare/0.1.0...0.1.1
|
|
||||||
|
- Phonetics and syllabification utilities
|
||||||
|
|
||||||
|
[Unreleased]: https://github.com/com.owoga/phonetics/compare/0.1.2...HEAD
|
||||||
|
[0.1.1]: https://github.com/com.owoga/phonetics/compare/0.1.1...0.1.2
|
||||||
|
Binary file not shown.
@ -0,0 +1,64 @@
|
|||||||
|
(ns com.owoga.phonetics.stress-manip
|
||||||
|
(:require [clojure.string :as string]))
|
||||||
|
|
||||||
|
(defn primary-stress?
|
||||||
|
[phone]
|
||||||
|
(re-find #"1" phone))
|
||||||
|
|
||||||
|
(defn non-primary-stress?
|
||||||
|
[phone]
|
||||||
|
(re-find #"[2-9]" phone))
|
||||||
|
|
||||||
|
(defn unstressed?
|
||||||
|
[phone]
|
||||||
|
(re-find #"0" phone))
|
||||||
|
|
||||||
|
(defn remove-any-stress-signifiers
|
||||||
|
[phones]
|
||||||
|
(map #(string/replace % #"\d" "") phones))
|
||||||
|
|
||||||
|
(defn remove-non-primary-stress-signifiers
|
||||||
|
[phones]
|
||||||
|
(map #(string/replace % #"[02-9]" "") phones))
|
||||||
|
|
||||||
|
(defn unify-stressed
|
||||||
|
[phones]
|
||||||
|
(map #(string/replace % #"[2-9]" "1") phones))
|
||||||
|
|
||||||
|
(def consonant-unification-map
|
||||||
|
"This almost aligns with the phonemap that maps phones to whether they are vowels, aspirates, nasals, etc...
|
||||||
|
Slight but possibly important difference in stops. For example, I think T and D
|
||||||
|
are more unified than T and G; and G and K are more unifide than G and T."
|
||||||
|
{"T" "T"
|
||||||
|
"CH" "CH"
|
||||||
|
"K" "K"
|
||||||
|
"HH" "HH"
|
||||||
|
"L" "L"
|
||||||
|
"JH" "CH" ;; <-
|
||||||
|
"G" "K" ;; <-
|
||||||
|
"M" "M" ;; <-
|
||||||
|
"S" "S"
|
||||||
|
"Y" "Y"
|
||||||
|
"Z" "S" ;; <-
|
||||||
|
"R" "R"
|
||||||
|
"F" "F"
|
||||||
|
"B" "B"
|
||||||
|
"SH" "CH" ;; <-
|
||||||
|
"P" "B" ;; <-
|
||||||
|
"V" "F" ;; <-
|
||||||
|
"TH" "T" ;; <-
|
||||||
|
"N" "M" ;; <-
|
||||||
|
"DH" "T" ;; <-
|
||||||
|
"W" "Y" ;; <-
|
||||||
|
"ZH" "S" ;; <-
|
||||||
|
"NG" "M" ;; <-
|
||||||
|
"D" "T" ;; <-
|
||||||
|
})
|
||||||
|
|
||||||
|
(defn unify-consonants
|
||||||
|
[phones]
|
||||||
|
(mapv #(get consonant-unification-map % %) phones))
|
||||||
|
|
||||||
|
(defn remove-unstressed-signifiers
|
||||||
|
[phones]
|
||||||
|
(map #(string/replace % #"0" "")))
|
Loading…
Reference in New Issue