Skip to content

Commit

Permalink
set up code customisation
Browse files Browse the repository at this point in the history
  • Loading branch information
johenglisch committed Mar 14, 2024
1 parent b1546ea commit add4494
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cldfbench_sinnemakizeromarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ def cmd_makecldf(self, args):
'LingVariables.csv', delimiter=';', dicts=True)
custom_parameters = self.etc_dir.read_csv('parameters.csv', dicts=True)
custom_parameters = {param['ID']: param for param in custom_parameters}
custom_codes = {
code['ID']: code
for code in self.etc_dir.read_csv('codes.csv', dicts=True)}

with open(metadata_folder / 'LingVariables.yaml') as f:
ling_variables = load_yaml(f, YamlLoader)
Expand Down Expand Up @@ -353,6 +356,10 @@ def cmd_makecldf(self, args):
}
for param_id, param in ling_variables.items()
for value, description in param.get('Levels', {}).items()]
for code in code_table:
if (custom_code := custom_codes.get(code['ID'])):
code['Name'] = custom_code.get('Name')
code['Description'] = custom_code.get('Description')

value_table = [
{
Expand Down
23 changes: 23 additions & 0 deletions etc/codes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ID,Parameter_ID,Name,Description
wordorderbinned5-v1,wordorderbinned5,V1,verb-initial order
wordorderbinned5-v3,wordorderbinned5,V3,verb-final order
wordorderbinned5-svo,wordorderbinned5,SVO,subject-verb-object order
wordorderbinned5-ovs,wordorderbinned5,OVS,object-verb-subject order
wordorderbinned5-nd,wordorderbinned5,nd,no dominant order
wordorderso-yes,wordorderso,yes,dominant subject-object order
wordorderso-no,wordorderso,no,either dominant object-subject order or no dominant order
wordorderbinned7-svo,wordorderbinned7,SVO,dominant subject-verb-object order
wordorderbinned7-sov,wordorderbinned7,SOV,dominant subject-object-verb order
wordorderbinned7-vso,wordorderbinned7,VSO,dominant verb-subject-object order
wordorderbinned7-vos,wordorderbinned7,VOS,dominant verb-object-subject order
wordorderbinned7-osv,wordorderbinned7,OSV,dominant object-subject-verb order
wordorderbinned7-ovs,wordorderbinned7,OVS,dominant object-verb-subject order
wordorderbinned7-nodom,wordorderbinned7,no dom.,no dominant word order
wordordersfirst-yes,wordordersfirst,yes,dominant word order is subject-first (including SVO and SOV orders)
wordordersfirst-no,wordordersfirst,no,dominant wordo order order is not subject-first (including verb-initial and object-initial orders)
morphmarking-yes,morphmarking,yes,there is overt morphological marking of lexical arguments (subject and/or object)
morphmarking-no,morphmarking,no,there is no overt marking of lexical arguments (subject and object)
headmarking-yes,headmarking,yes,there is head marking of lexical arguments (subject and/or object)
headmarking-no,headmarking,no,there is no head marking of lexical arguments (subject and object)
dependentmarking-yes,dependentmarking,yes,there is dependent marking of lexical arguments (subject and/or object)
dependentmarking-no,dependentmarking,no,there is no dependent marking of lexical arguments (subject and object)

0 comments on commit add4494

Please sign in to comment.