-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from Forced-Alignment-and-Vowel-Extraction/dev
v0.3.0
- Loading branch information
Showing
30 changed files
with
731 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,4 +162,5 @@ cython_debug/ | |
|
||
notebooks/ | ||
.vscode/ | ||
poetry.lock | ||
poetry.lock | ||
cov.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
title: Codeblocklabel | ||
author: Josef Fruehwald | ||
version: 1.0.0 | ||
quarto-required: ">=1.3.0" | ||
contributes: | ||
filters: | ||
- codeblocklabel.lua | ||
|
10 changes: 10 additions & 0 deletions
10
docs/_extensions/jofrhwld/codeblocklabel/codeblocklabel.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.langname { | ||
margin-bottom: 0%; | ||
padding-bottom: 0%; | ||
font-style: italic; | ||
font-size:smaller; | ||
} | ||
|
||
.sourceCode[id]{ | ||
margin-top: 0%; | ||
} |
30 changes: 30 additions & 0 deletions
30
docs/_extensions/jofrhwld/codeblocklabel/codeblocklabel.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
-- function Div(el) | ||
-- if el.content[1].t == "CodeBlock" then | ||
-- return pandoc.Para("CodeBlock!") | ||
-- end | ||
-- end | ||
|
||
quarto.doc.add_html_dependency({ | ||
name = 'codenamelabel', | ||
stylesheets = {'codeblocklabel.css'} | ||
}) | ||
|
||
function CodeBlock(block) | ||
local newblock = block | ||
if (FORMAT:match "html") and | ||
(block.classes[1]) then | ||
local langname = block.classes[1] | ||
out = {pandoc.Div( | ||
pandoc.RawInline("html", | ||
"<pre class='langname'>"..block.classes[1].."</pre>" | ||
), | ||
pandoc.Attr("", {"langname"}, {}) | ||
), | ||
newblock | ||
} | ||
else | ||
out = newblock | ||
end | ||
return out | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: Label Set Parsers | ||
engine: jupyter | ||
toc: true | ||
--- | ||
|
||
There are some properties of label sets that you might want to include in your output labels. | ||
For example, the CMU dictionary encodes vowel stress like so: | ||
|
||
| label | meaning | | ||
| ---- | ---- | | ||
| `AY0` | unstressed /ay/ | | ||
| `AY2` | secondary stressed /ay/ | | ||
| `AY1` | primary stressed /ay/ | | ||
|
||
A labelset parser can make these properties available so you can write a recoding rule like so: | ||
|
||
```yaml | ||
- rule: ay | ||
conditions: | ||
- attribute: label | ||
relation: contains | ||
set: AY | ||
return: ay_{stress} | ||
``` | ||
`fave_recode` has built in parser for CMU labels called `cmu_parser` that you can include like so | ||
|
||
```bash | ||
fave_recode \ | ||
-i data/josef-fruehwald_speaker.TextGrid \ | ||
-s cmu2phila \ | ||
-a cmu_parser | ||
``` | ||
|
||
## Label Set Parser Basics | ||
|
||
A labelset parser has two top level attributes | ||
|
||
```yaml | ||
parser: CMU | ||
properties: [] | ||
``` | ||
|
||
- `parser` just names the parser | ||
- `properties` is a list of properties you wish to make available. | ||
|
||
### A property | ||
|
||
A single property that parses primary stress out of the cmu label would look like this: | ||
|
||
```yaml | ||
name: stress | ||
updates: stress | ||
default: "" | ||
rules: | ||
- rule: "1" | ||
conditions: | ||
- attribute: label | ||
relation: contains | ||
set: "1" | ||
return: "1" | ||
``` | ||
|
||
The `rule` component is identical to [rules for recoding](rule-scheme-basics.qmd). | ||
|
||
The `updates` field defines the variable name you want to use to access the value "1" in our recoding rule. | ||
|
||
Unlike a recoding rule, every segment will be given some value for "stress", so a `default` value also needs to be provided. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"project": "fave_recode", "version": "0.0.9999", "count": 16, "items": [{"name": "fave_recode.rule_classes.Condition.check_condition", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Condition.html#fave_recode.rule_classes.Condition.check_condition", "dispname": "-"}, {"name": "fave_recode.rule_classes.Condition.validate_condition", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Condition.html#fave_recode.rule_classes.Condition.validate_condition", "dispname": "-"}, {"name": "fave_recode.rule_classes.Condition", "domain": "py", "role": "class", "priority": "1", "uri": "reference/rule_classes.Condition.html#fave_recode.rule_classes.Condition", "dispname": "-"}, {"name": "fave_recode.rule_classes.Rule.apply_rule", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Rule.html#fave_recode.rule_classes.Rule.apply_rule", "dispname": "-"}, {"name": "fave_recode.rule_classes.Rule.validate_rule", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Rule.html#fave_recode.rule_classes.Rule.validate_rule", "dispname": "-"}, {"name": "fave_recode.rule_classes.Rule", "domain": "py", "role": "class", "priority": "1", "uri": "reference/rule_classes.Rule.html#fave_recode.rule_classes.Rule", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet.apply_ruleset", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet.apply_ruleset", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet.map_ruleset", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet.map_ruleset", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet.read_ruleset", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet.read_ruleset", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet", "domain": "py", "role": "class", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet", "dispname": "-"}, {"name": "fave_recode.relations.in_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.in_relation.html#fave_recode.relations.in_relation", "dispname": "-"}, {"name": "fave_recode.relations.not_in_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.not_in_relation.html#fave_recode.relations.not_in_relation", "dispname": "-"}, {"name": "fave_recode.relations.equals_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.equals_relation.html#fave_recode.relations.equals_relation", "dispname": "-"}, {"name": "fave_recode.relations.not_equals_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.not_equals_relation.html#fave_recode.relations.not_equals_relation", "dispname": "-"}, {"name": "fave_recode.relations.rematches_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.rematches_relation.html#fave_recode.relations.rematches_relation", "dispname": "-"}, {"name": "fave_recode.relations.reunmatches_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.reunmatches_relation.html#fave_recode.relations.reunmatches_relation", "dispname": "-"}]} | ||
{"project": "fave_recode", "version": "0.0.9999", "count": 23, "items": [{"name": "fave_recode.rule_classes.Condition.check_condition", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Condition.html#fave_recode.rule_classes.Condition.check_condition", "dispname": "-"}, {"name": "fave_recode.rule_classes.Condition.validate_condition", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Condition.html#fave_recode.rule_classes.Condition.validate_condition", "dispname": "-"}, {"name": "fave_recode.rule_classes.Condition", "domain": "py", "role": "class", "priority": "1", "uri": "reference/rule_classes.Condition.html#fave_recode.rule_classes.Condition", "dispname": "-"}, {"name": "fave_recode.rule_classes.Rule.apply_rule", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Rule.html#fave_recode.rule_classes.Rule.apply_rule", "dispname": "-"}, {"name": "fave_recode.rule_classes.Rule.validate_rule", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.Rule.html#fave_recode.rule_classes.Rule.validate_rule", "dispname": "-"}, {"name": "fave_recode.rule_classes.Rule", "domain": "py", "role": "class", "priority": "1", "uri": "reference/rule_classes.Rule.html#fave_recode.rule_classes.Rule", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet.apply_ruleset", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet.apply_ruleset", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet.map_ruleset", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet.map_ruleset", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet.read_ruleset", "domain": "py", "role": "function", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet.read_ruleset", "dispname": "-"}, {"name": "fave_recode.rule_classes.RuleSet", "domain": "py", "role": "class", "priority": "1", "uri": "reference/rule_classes.RuleSet.html#fave_recode.rule_classes.RuleSet", "dispname": "-"}, {"name": "fave_recode.labelset_parser.LabelSetParser.apply_parser", "domain": "py", "role": "function", "priority": "1", "uri": "reference/labelset_parser.LabelSetParser.html#fave_recode.labelset_parser.LabelSetParser.apply_parser", "dispname": "-"}, {"name": "fave_recode.labelset_parser.LabelSetParser.map_parser", "domain": "py", "role": "function", "priority": "1", "uri": "reference/labelset_parser.LabelSetParser.html#fave_recode.labelset_parser.LabelSetParser.map_parser", "dispname": "-"}, {"name": "fave_recode.labelset_parser.LabelSetParser.read_parser", "domain": "py", "role": "function", "priority": "1", "uri": "reference/labelset_parser.LabelSetParser.html#fave_recode.labelset_parser.LabelSetParser.read_parser", "dispname": "-"}, {"name": "fave_recode.labelset_parser.LabelSetParser.validate_parser", "domain": "py", "role": "function", "priority": "1", "uri": "reference/labelset_parser.LabelSetParser.html#fave_recode.labelset_parser.LabelSetParser.validate_parser", "dispname": "-"}, {"name": "fave_recode.labelset_parser.LabelSetParser", "domain": "py", "role": "class", "priority": "1", "uri": "reference/labelset_parser.LabelSetParser.html#fave_recode.labelset_parser.LabelSetParser", "dispname": "-"}, {"name": "fave_recode.labelset_parser.LabelSetParserProperties.validate_property", "domain": "py", "role": "function", "priority": "1", "uri": "reference/labelset_parser.LabelSetParserProperties.html#fave_recode.labelset_parser.LabelSetParserProperties.validate_property", "dispname": "-"}, {"name": "fave_recode.labelset_parser.LabelSetParserProperties", "domain": "py", "role": "class", "priority": "1", "uri": "reference/labelset_parser.LabelSetParserProperties.html#fave_recode.labelset_parser.LabelSetParserProperties", "dispname": "-"}, {"name": "fave_recode.relations.in_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.in_relation.html#fave_recode.relations.in_relation", "dispname": "-"}, {"name": "fave_recode.relations.not_in_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.not_in_relation.html#fave_recode.relations.not_in_relation", "dispname": "-"}, {"name": "fave_recode.relations.equals_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.equals_relation.html#fave_recode.relations.equals_relation", "dispname": "-"}, {"name": "fave_recode.relations.not_equals_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.not_equals_relation.html#fave_recode.relations.not_equals_relation", "dispname": "-"}, {"name": "fave_recode.relations.rematches_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.rematches_relation.html#fave_recode.relations.rematches_relation", "dispname": "-"}, {"name": "fave_recode.relations.reunmatches_relation", "domain": "py", "role": "function", "priority": "1", "uri": "reference/relations.reunmatches_relation.html#fave_recode.relations.reunmatches_relation", "dispname": "-"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.