# -*- coding: utf-8 -*-

# This is a feature definition file for IPA 2005. See:
# https://www.internationalphoneticassociation.org/content/full-ipa-chart
#
# Unicode characters can be found at:
# https://westonruter.github.io/ipa-chart/keyboard/
#
# The following tokens will be ignored:
# Primary stress, Secondary stress, Minor (foot) group, Major (intonation) group, 
# Syllable break, Linking (absence of a break)

##
## OPERATION WEIGHTS
##
## Indel: 1.0
##
## Substitution of tokens with the same base symbol, 
## differing only in one or more diacritics: 0.3
##
## Substitution of vowel with consonant: 2.0
##
## Other substitution: 1.0
##

########
DEFINES
########

VERSION 2             # 0|1|2 (default: 0)

TOP 65535             # output maximum (default: 65535)

SUBSTMAX 2.1          # maximum for a substitution; larger values are cut off (default: 1)

INDEL 1.0             # indel, if not specified otherwise (default: .5 * SUBSTMAX)

METHOD SUM            # SUM|SQUARE|EUCLID|(MINKOWSKI value)  (default: SUM)

TOKENSTRING RAW       # RAW|ESC (default: RAW)

START 0               # STATE at start of string (default: 0)

RANGE 0.01 0.99 0.3   # everything in range 0.01:0.99 will be set to 0.3
RANGE 1 50 1          # everything in range 1:50 will be set to 1
RANGE 50 1000 2.1     # everything in range 50:1000 will be set to 2.1

########
FEATURES
########

# This file uses VERSION 2 (see DEFINES above)

# VERSION 0
# B|N|D label
# B|N|D weight label

# VERSION 1 and VERSION 2
# B|N|D default_diff label
# B|N|D default_diff weight label

# B : bitmap   (integer)
# N : numeric  (float)
# D : discrete (integer numbers)

B 1 100 type
D 1 1 id

N 1 0.02 mod02B0
N 1 0.02 mod02B2
N 1 0.02 mod02B7
N 1 0.02 mod02BC
N 1 0.02 mod02D0
N 1 0.02 mod02D1
N 1 0.02 mod02DE
N 1 0.02 mod02E0
N 1 0.02 mod02E1
N 1 0.02 mod02E4
N 1 0.02 mod02E5
N 1 0.02 mod02E6
N 1 0.02 mod02E7
N 1 0.02 mod02E8
N 1 0.02 mod02E9
N 1 0.02 mod0300
N 1 0.02 mod0301
N 1 0.02 mod0302
N 1 0.02 mod0303
N 1 0.02 mod0304
N 1 0.02 mod0306
N 1 0.02 mod0308
N 1 0.02 mod030B
N 1 0.02 mod030C
N 1 0.02 mod030F
N 1 0.02 mod0318
N 1 0.02 mod0319
N 1 0.02 mod031A
N 1 0.02 mod031C
N 1 0.02 mod031D
N 1 0.02 mod031E
N 1 0.02 mod031F
N 1 0.02 mod0320
N 1 0.02 mod0324
N 1 0.02 mod0325
N 1 0.02 mod0329
N 1 0.02 mod032A
N 1 0.02 mod032C
N 1 0.02 mod032F
N 1 0.02 mod0330
N 1 0.02 mod0339
N 1 0.02 mod033A
N 1 0.02 mod033B
N 1 0.02 mod033C
N 1 0.02 mod033D
N 1 0.02 mod1DC4
N 1 0.02 mod1DC5
N 1 0.02 mod1DC8
N 1 0.02 mod207F
N 1 0.02 mod2191
N 1 0.02 mod2193
N 1 0.02 mod2197
N 1 0.02 mod2198

########
TEMPLATES
########

T vowel
F type = 1
F STATE + 1

T consonant
F type = 2
F STATE + 1

T semivowel
F type = 3
F STATE + 1

T sonorant
F type + 4

T stress
F type = 255
F INDEL = 0.5
F STATE - 1

T punctuation
F type = 255
F INDEL = 0.5
F STATE - 1

T unknown
F type = 255
F STATE + 1

T mods
F mod02B0 = 0
F mod02B2 = 0
F mod02B7 = 0
F mod02BC = 0
F mod02D0 = 0
F mod02D1 = 0
F mod02DE = 0
F mod02E0 = 0
F mod02E1 = 0
F mod02E4 = 0
F mod02E5 = 0
F mod02E6 = 0
F mod02E7 = 0
F mod02E8 = 0
F mod02E9 = 0
F mod0300 = 0
F mod0301 = 0
F mod0302 = 0
F mod0303 = 0
F mod0304 = 0
F mod0306 = 0
F mod0308 = 0
F mod030B = 0
F mod030C = 0
F mod030F = 0
F mod0318 = 0
F mod0319 = 0
F mod031A = 0
F mod031C = 0
F mod031D = 0
F mod031E = 0
F mod031F = 0
F mod0320 = 0
F mod0324 = 0
F mod0325 = 0
F mod0329 = 0
F mod032A = 0
F mod032C = 0
F mod032F = 0
F mod0330 = 0
F mod0339 = 0
F mod033A = 0
F mod033B = 0
F mod033C = 0
F mod033D = 0
F mod1DC4 = 0
F mod1DC5 = 0
F mod1DC8 = 0
F mod207F = 0
F mod2191 = 0
F mod2193 = 0
F mod2197 = 0
F mod2198 = 0

########
INDELS
########

# (nothing)

########
TOKENS
########

# vowels

H a
T vowel mods
F id = 97

H e
T vowel mods
F id = 101

H o
T vowel mods
F id = 111

H y
T vowel mods
F id = 121

H æ
T vowel mods
F id = 230

H ø
T vowel mods
F id = 248

H œ
T vowel mods
F id = 339

H ɐ
T vowel mods
F id = 592

H ɑ
T vowel mods
F id = 593

H ɒ
T vowel mods
F id = 594

H ɔ
T vowel mods
F id = 596

H ɘ
T vowel mods
F id = 600

H ə
T vowel sonorant mods
F id = 601

H ɛ
T vowel mods
F id = 603

H ɜ
T vowel mods
F id = 604

H ɞ
T vowel mods
F id = 606

H ɤ
T vowel mods
F id = 612

H ɨ
T vowel mods
F id = 616

H ɪ
T vowel mods
F id = 618

H ɯ
T vowel mods
F id = 623

H ɵ
T vowel mods
F id = 629

H ɶ
T vowel mods
F id = 630

H ʉ
T vowel mods
F id = 649

H ʊ
T vowel mods
F id = 650

H ʌ
T vowel mods
F id = 652

H ʏ
T vowel mods
F id = 655

# consonants

H b
T consonant mods
F id = 98

H c
T consonant mods
F id = 99

H d
T consonant mods
F id = 100

H f
T consonant mods
F id = 102

H h
T consonant mods
F id = 104

H k
T consonant mods
F id = 107

H l
T consonant sonorant mods
F id = 108

H m
T consonant sonorant mods
F id = 109

H n
T consonant sonorant mods
F id = 110

H p
T consonant mods
F id = 112

H q
T consonant mods
F id = 113

H r
T consonant sonorant mods
F id = 114

H s
T consonant mods
F id = 115

H t
T consonant mods
F id = 116

H v
T consonant mods
F id = 118

H x
T consonant mods
F id = 120

H z
T consonant mods
F id = 122

H ç
T consonant mods
F id = 231

H ð
T consonant mods
F id = 240

H ħ
T consonant mods
F id = 295

H ŋ
T consonant sonorant mods
F id = 331

H ǀ
T consonant mods
F id = 448

H ǁ
T consonant mods
F id = 449

H ǂ
T consonant mods
F id = 450

H ǃ
T consonant mods
F id = 451

H ɓ
T consonant mods
F id = 595

H ɕ
T consonant mods
F id = 597

H ɖ
T consonant mods
F id = 598

H ɗ
T consonant mods
F id = 599

H ɟ
T consonant mods
F id = 607

H ɠ
T consonant mods
F id = 608

H ɡ
T consonant mods
F id = 609

H ɢ
T consonant mods
F id = 610

H ɣ
T consonant mods
F id = 611

H ɦ
T consonant mods
F id = 614

H ɧ
T consonant mods
F id = 615

H ɫ
T consonant sonorant mods
F id = 619

H ɬ
T consonant mods
F id = 620

H ɭ
T consonant sonorant mods
F id = 621

H ɮ
T consonant mods
F id = 622

H ɱ
T consonant sonorant mods
F id = 625

H ɲ
T consonant sonorant mods
F id = 626

H ɳ
T consonant sonorant mods
F id = 627

H ɴ
T consonant sonorant mods
F id = 628

H ɸ
T consonant mods
F id = 632

H ɺ
T consonant sonorant mods
F id = 634

H ɽ
T consonant sonorant mods
F id = 637

H ɾ
T consonant sonorant mods
F id = 638

H ʀ
T consonant sonorant mods
F id = 640

H ʁ
T consonant mods
F id = 641

H ʂ
T consonant mods
F id = 642

H ʃ
T consonant mods
F id = 643

H ʄ
T consonant mods
F id = 644

H ʈ
T consonant mods
F id = 648

H ʍ
T consonant mods
F id = 653

H ʎ
T consonant sonorant mods
F id = 654

H ʐ
T consonant mods
F id = 656

H ʑ
T consonant mods
F id = 657

H ʒ
T consonant mods
F id = 658

H ʔ
T consonant mods
F id = 660

H ʕ
T consonant mods
F id = 661

H ʘ
T consonant mods
F id = 664

H ʙ
T consonant sonorant mods
F id = 665

H ʛ
T consonant mods
F id = 667

H ʜ
T consonant mods
F id = 668

H ʝ
T consonant mods
F id = 669

H ʟ
T consonant sonorant mods
F id = 671

H ʡ
T consonant mods
F id = 673

H ʢ
T consonant mods
F id = 674

H β
T consonant mods
F id = 946

H θ
T consonant mods
F id = 952

H χ
T consonant mods
F id = 967

H ⱱ
T consonant sonorant mods
F id = 11377

H ɚ
T vowel mods
F id = 602

H ɥ
T consonant sonorant mods
F id = 613

H ɰ
T consonant sonorant mods
F id = 624

H ɹ
T consonant sonorant mods
F id = 633

H ɻ
T consonant sonorant mods
F id = 635

H ʋ
T consonant sonorant mods
F id = 651

# semivowels

H i
T semivowel mods
F id = 105

H u
T semivowel mods
F id = 117

H j
T semivowel mods
F id = 106

H w
T semivowel mods
F id = 119

# affricates

H t͡ʃ
T consonant mods
F id = 1001

H t͡s
T consonant mods
F id = 1002

H d͡ʒ
T consonant mods
F id = 1003

H k͡p
T consonant mods
F id = 1004

# stress

# punctuation

MI ͜
T punctuation mods
F id = 860

MI ͡
T punctuation mods
F id = 865

# unknown

# modifiers

: 1 M ʰ
F mod02B0 + 1

: 1 M ʲ
F mod02B2 + 1

: 1 M ʷ
F mod02B7 + 1

: 1 M ʼ
F mod02BC + 1

: 1 M ː
F mod02D0 + 1

: 1 M ˑ
F mod02D1 + 1

: 1 M ˞
F mod02DE + 1

: 1 M ˠ
F mod02E0 + 1

: 1 M ˡ
F mod02E1 + 1

: 1 M ˤ
F mod02E4 + 1

: 1 M ˥
F mod02E5 + 1

: 1 M ˦
F mod02E6 + 1

: 1 M ˧
F mod02E7 + 1

: 1 M ˨
F mod02E8 + 1

: 1 M ˩
F mod02E9 + 1

: 1 M ̀
F mod0300 + 1

: 1 M ́
F mod0301 + 1

: 1 M ̂
F mod0302 + 1

: 1 M ̃
F mod0303 + 1

: 1 M ̄
F mod0304 + 1

: 1 M ̆
F mod0306 + 1

: 1 M ̈
F mod0308 + 1

: 1 M ̋
F mod030B + 1

: 1 M ̌
F mod030C + 1

: 1 M ̏
F mod030F + 1

: 1 M ̘
F mod0318 + 1

: 1 M ̙
F mod0319 + 1

: 1 M ̚
F mod031A + 1

: 1 M ̜
F mod031C + 1

: 1 M ̝
F mod031D + 1

: 1 M ̞
F mod031E + 1

: 1 M ̟
F mod031F + 1

: 1 M ̠
F mod0320 + 1

: 1 M ̤
F mod0324 + 1

: 1 M ̥
F mod0325 + 1

: 1 M ̩
F mod0329 + 1

: 1 M ̪
F mod032A + 1

: 1 M ̬
F mod032C + 1

: 1 M ̯
F mod032F + 1

: 1 M ̰
F mod0330 + 1

: 1 M ̹
F mod0339 + 1

: 1 M ̺
F mod033A + 1

: 1 M ̻
F mod033B + 1

: 1 M ̼
F mod033C + 1

: 1 M ̽
F mod033D + 1

: 1 M ᷄
F mod1DC4 + 1

: 1 M ᷅
F mod1DC5 + 1

: 1 M ᷈
F mod1DC8 + 1

: 1 M ⁿ
F mod207F + 1

: 1 M ↑
F mod2191 + 1

: 1 M ↓
F mod2193 + 1

: 1 M ↗
F mod2197 + 1

: 1 M ↘
F mod2198 + 1

