Nasc documentation
Contents
- About NASC
- Interface
- Using comments
- Anatomy of a rule
- Change basics
- Condition basics
- Simple condition
- Multiple conditions in one rule
- Word boundaries
- Wildcard
- Matching previous expression
- Matching multitudes of previous expression
- Matching multitudes of wildcards
- Exception basics
- Categories
- Features
- Intermediate rules
- Advanced rules
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Flags
- Matching the right character
- Do, Then and Else
- Clusterfield
- Cheatsheat
About NASC
This is the complete documentation for NASC version 1.0.0
Interface
Word divider
Use the Apply button
Options
Verbose mode
Editor wrap-lines
File save / load
Use the Save
button to download your sound changes as a file called 'NASC.txt', or what you named your file in the File name:
field. The file is always a ".txt" type.
Use the Load
button to load a file on your system into the file editor.
Using comments
Comments are made with a semicolon ;
anything after it on the same line is treated as a comment. Comments are useful to explain what a rule does.
; This is a comment
e > o ;and this is a comment following a rule.
Anatomy of a rule
The format of all parts of a NASC rule can be summarised as
CHANGE / CONDITION ! EXCEPTION | FLAG
Every rule must begin on a new line and contain a CHANGE. The CONDITION, EXCEPTION or FLAG parts are optional.
Change basics
The format of The Change can be expressed as BEFORE > AFTER
.
BEFORE
specifies which part of the word is being changed. Then followed by a space and the >
character. >
can be swapped with either ->
, =>
, ⇒
or →
if you prefer. AFTER
is what BEFORE
is changing into, or in other words, replacing.
Simple change
Let's look at a simple unconditional rule.
; Replace every [o] with an [x]
o -> x
; bodido ==> bxdidx
In this rule, we see every instance of o become x.
Concurrent change
A concurrent change is achieved by listing multiple phonemes in BEFORE
separated by commas, and listing the same amount of resultant phonemes in AFTER
separated by commas. Changes in a concurrent change happen at the same time.
; Switch [o] and [e] around
o, a -> a, o
; boda ==> bado
Notice that the above example is different to the example below:
o -> a
a -> o
; boda ==> bodo
where each change is on its own line. We can see o
merge with a
, then a
becomes o
.
Merging change
Merging change is accomplished by placing a list of phonemes in BEFORE
separated by spaces.
; Three phonemes becoming two phonemes
ʃ z, dz -> s, d
; zeʃadzas ==> sesadas
Optional change
Optional change only works when it connects an expression without spaces.
; Merge [x] and [xw] into [h]
x(w) -> h
; xwaxaħa ==> hahaħa
Optional change can also attach to a list of phonemes in a set of curly braces.
; Merge [x], [xw], [ħ] and [ħw] into [h]
{x ħ}(w) -> h
; xwaxaħa ==> hahaha
The optionalised segment can also have a result in AFTER
if it is captured.
; Like the previous rule, but preserve labialisation
{x ħ}(w) -> h(w)
; xwaxaħa ==> hwahaha
The optionalised segment can also be a concurrent change, or
; Like the previous rule, but preserve palatalisation and labialisation
{x ħ}(w, j) -> h(w, j)
; xwaxjaxa ==> hwahjaha
a merging change.
; Like the previous rule, but preserve palatalisation and merge it with labialisation
{x ħ}(w j) -> h(j)
; xwaxjaxa ==> hjahjaha
Condition basics
The format of a condition is / PRE_POST
.
Conditions follow The Change and are placed after a forward slash. The condition may also be called the environment.
PRE
is everything before the target. The underscore is a reference to the target. POST
is everything after the target
Simple condition
; Change [a] into [e] only when it is between [p]s
a -> e / p_p
; apaptat ==> apeptat
Multiple conditions in one rule
a -> e / p_p / t_t
; apaptat ==> apeptet
Word boundaries
a -> e / p_p#
; apappap ==> apappep
Wildcard
a -> e / _[]
; apappap ==> apappep
Previous
a -> e / r~_-
; apappap ==> apappep
Multitudes of previous
a -> e / r+_-
; apappap ==> apappep
Multitudes of wildcard
a -> e / r[]+_
; apappap ==> apappep
Exception basics
Exception without context
Simple Exception
Complex Exception
The below rule demonstrates multiple exceptions, word boundaries, wildcards and previouses
a -> o ! #_, _#
; apappapa ==> apoppopa
Word-based exception
swore sworn
Word-based exceptions
Categories
p, t, k -> b, d, g / [a e i o u]_[a e i o u]
The above rule can be transfered to the below rule:
plosive = p t k
fricative = f s x
vowel = a e i o u
[plosive] > [fricative] / [vowel]_[vowel];
; papatakak ==> pafasaxak
Features
featureset: ipa
[nasal]
The other featureset is called ANSX-SAMPA
featureset: ansx-sampa
[nasal]
Positioning
Positions are a way of capturing the target when it is the Nth amount in a word
a@[2] -> o / b_b
babaaabab ==> babaaabob
Intermediate rules
Insertion
^ -> a / b_t
; bt ==> bat
Deletion
b -> ^
; bubda ==> uda
Gemination
p -> p" / a_a
Degemination
p -> ^ / "_
p -> ^ / "_
pap.pa ==> pa.pa
Advanced rules
Metathesis
Metathesis in NASC refers to reordering of phonemes in a word
Local two place metathesis
The most typical metathesis will be local two-place metathesis
; An intervocalic stop + nasal sequence will become nasal + stop
[stop]&[nasal] -> 2&1 / V__V
; watna > wanta
One-place metathesis
Gascon forming word initial cluster except where stress first syllable or first consonant is m or h
[stop]&r -> 12& / #_+_ ! #"
;kabatros > krabatos
Long-distance metathesis
v&l -> l&v / _._
;cavalry > calavry
v&l -> 21& / _._
;cavalry > calvary
r&o&l -> l&^&r
/_...[plosive]__
; parabola ==> palabra
Partially simulating Latin to Spanish [r] and [l] metathesis triggered by elision of unstressed vowels
do:
; Delete vowels when unstressed and not at a word boundary
a, e, i, o, u > * / _{r,l} ! _@1 ! _@-1
then:
; Switch [l] and [r]
r&l -> l&r /_...[plosive]__
; parábola ==> palabra
Blockers and non-blockers
[a i u] > [ã ĩ ũ] / [ã ĩ ũ].*_{cons(nonblocker)}
pabãdruliga > pabãdrũlĩga
[i ɯ] > [y u] / {vowel([ö y o u])}.*_
pödi-podɯ-pedi > pödy-podu-pedi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Flags
Flags are a way to modify how an individual rule is executed. They are placed at the very end of a rule following a |
.
Reverse
Strict
Strict Reverse
S R F L percentage
Matching the right character
Escaping syntax character
Graphs
Combining diacritics
Invisible
Depending on your input, you may want some graphs to, for example ignoring stress markers and syllable boundaries.
invisible: \. ˈ
tt > dd
; at.ˈta ==> ad.ˈda
Do, Then and Else
Clusterfield
Cheatsheet
Symbol | Context | Example | Explanation |
---|---|---|---|
; | Anywhere | ; This is a comment | Anything after the symbol is ignored until newline. |
> | |||