-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPreDefinedData.cs
More file actions
89 lines (81 loc) · 4.84 KB
/
Copy pathPreDefinedData.cs
File metadata and controls
89 lines (81 loc) · 4.84 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using LcmCrdt.Changes;
using SIL.Harmony;
namespace LcmCrdt.Objects;
public static class PreDefinedData
{
// Complex form type GUIDs — referenced by callers seeding entries.
public static readonly Guid CompoundComplexFormTypeId = new("c36f55ed-d1ea-4069-90b3-3f35ff696273");
public static readonly Guid UnspecifiedComplexFormTypeId = new("eeb78fce-6009-4932-aaa6-85faeb180c69");
// Part-of-speech GUIDs — canonical, from GOLDEtic.xml in liblcm.
public static readonly Guid NounPartOfSpeechId = new("a8e41fd3-e343-4c7c-aa05-01ea3dd5cfb5");
public static readonly Guid VerbPartOfSpeechId = new("86ff66f6-0774-407a-a0dc-3eeaf873daf7");
public static readonly Guid AdjectivePartOfSpeechId = new("30d07580-5052-4d91-bc24-469b8b2d7df9");
public static readonly Guid AdverbPartOfSpeechId = new("46e4fe08-ffa0-4c8b-bf98-2c56f38904d9");
internal static async Task AddPredefinedComplexFormTypes(DataModel dataModel, ProjectData projectData)
{
await dataModel.AddChanges(projectData.ClientId,
[
new CreateComplexFormType(CompoundComplexFormTypeId, new MultiString() { { "en", "Compound" } } ),
new CreateComplexFormType(UnspecifiedComplexFormTypeId, new MultiString() { { "en", "Unspecified" } })
]);
}
internal static async Task AddPredefinedSemanticDomains(DataModel dataModel, ProjectData projectData)
{
//todo load from xml instead of hardcoding and use real IDs
await dataModel.AddChanges(projectData.ClientId,
[
new CreateSemanticDomainChange(new Guid("63403699-07c1-43f3-a47c-069d6e4316e5"), new MultiString() { { "en", "Universe, Creation" } }, "1", true),
new CreateSemanticDomainChange(new Guid("999581c4-1611-4acb-ae1b-5e6c1dfe6f0c"), new MultiString() { { "en", "Sky" } }, "1.1", true),
new CreateSemanticDomainChange(new Guid("dc1a2c6f-1b32-4631-8823-36dacc8cb7bb"), new MultiString() { { "en", "World" } }, "1.2", true),
new CreateSemanticDomainChange(new Guid("1bd42665-0610-4442-8d8d-7c666fee3a6d"), new MultiString() { { "en", "Person" } }, "2", true),
new CreateSemanticDomainChange(new Guid("46e4fe08-ffa0-4c8b-bf88-2c56f38904d4"), new MultiString() { { "en", "Body" } }, "2.1", false),
new CreateSemanticDomainChange(new Guid("46e4fe08-ffa0-4c8b-bf88-2c56f38904d5"), new MultiString() { { "en", "Head" } }, "2.1.1", false),
new CreateSemanticDomainChange(new Guid("46e4fe08-ffa0-4c8b-bf88-2c56f38904d6"), new MultiString() { { "en", "Eye" } }, "2.1.1.1", false),
]);
}
public static async Task AddPredefinedPartsOfSpeech(DataModel dataModel, ProjectData projectData)
{
//todo load from xml instead of hardcoding
await dataModel.AddChanges(projectData.ClientId,
[
new CreatePartOfSpeechChange(NounPartOfSpeechId, new MultiString() { { "en", "Noun" } }, true),
new CreatePartOfSpeechChange(VerbPartOfSpeechId, new MultiString() { { "en", "Verb" } }, true),
new CreatePartOfSpeechChange(AdjectivePartOfSpeechId, new MultiString() { { "en", "Adjective" } }, true),
new CreatePartOfSpeechChange(AdverbPartOfSpeechId, new MultiString() { { "en", "Adverb" } }, true),
]);
}
internal static async Task AddPredefinedCustomViews(DataModel dataModel, ProjectData projectData)
{
await dataModel.AddChanges(projectData.ClientId,
[
new CreateCustomViewChange(
new Guid("a1b2c3d4-e5f6-7890-abcd-ef1234567890"),
new CustomView
{
Id = new Guid("a1b2c3d4-e5f6-7890-abcd-ef1234567890"),
Name = "Minimal",
Base = ViewBase.FwLite,
EntryFields =
[
new ViewField { FieldId = "lexemeForm" },
],
SenseFields =
[
new ViewField { FieldId = "gloss" },
],
ExampleFields =
[
new ViewField { FieldId = "sentence" },
new ViewField { FieldId = "translations" },
],
Vernacular = [new ViewWritingSystem { WsId = "de" }, new ViewWritingSystem { WsId = "de-Zxxx-x-audio" }],
Analysis = [new ViewWritingSystem { WsId = "en" }]
})
]);
}
internal static async Task AddPredefinedMorphTypes(DataModel dataModel, ProjectData projectData)
{
await dataModel.AddChanges(projectData.ClientId,
[.. CanonicalMorphTypes.All.Values.Select(mt => new CreateMorphTypeChange(mt))]);
}
}