summaryrefslogtreecommitdiff
path: root/CLAUDE.md
blob: 40e0fb0f15b437d9abd844f9d9180f1532ab890a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Build and Development Commands

```bash
# Build the project
cd sorsyl && dune build

# Run tests
cd sorsyl && dune test

# Clean build artifacts
cd sorsyl && dune clean

# Install dependencies (if needed)
opam install --deps-only .
```

## Project Architecture

Sorsyl is an OCaml library for phonological analysis, specifically focused on sonority calculation for IPA (International Phonetic Alphabet) segments.

### Core Components

- **lib/sonority.ml**: Main sonority calculation logic using a decision tree based on phonological features (scale 1-9: voiceless stops to low vowels)
- **lib/feature.ml**: Phonological feature definitions and segment representation
- **lib/ipa_table.ml**: CSV data loading and IPA segment lookup functionality

### Data Files

The `data/` directory contains:
- `ipa_all.csv`: Main IPA character database with phonological features
- Various YAML configuration files for linguistic data (ASJP, diacritic definitions, etc.)

### Decision Tree Sonority Scale

The sonority calculation uses phonological features to classify segments:
- 9: Low vowels (most sonorous)
- 8: High vowels  
- 7: Glides/approximants
- 6: Liquids
- 5: Nasals
- 4: Voiced fricatives
- 3: Voiceless fricatives
- 2: Voiced stops
- 1: Voiceless stops (least sonorous)

### Development Environment

Uses devenv.nix for development environment setup with OCaml toolchain and dependencies (csv, base, stdio libraries).

The main executable (bin/main.ml) is currently incomplete - contains only a failwith placeholder.