Skip to content

Commit c95af0c

Browse files
committed
Explicitly default to MorphType.Stem in several places
1 parent 2f5d426 commit c95af0c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,10 @@ private Entry FromLexEntry(ILexEntry entry)
597597
LexemeForm = FromLcmMultiString(entry.LexemeFormOA?.Form),
598598
CitationForm = FromLcmMultiString(entry.CitationForm),
599599
LiteralMeaning = FromLcmMultiString(entry.LiteralMeaning),
600-
MorphType = LcmHelpers.FromLcmMorphTypeId(entry.PrimaryMorphType.Id.Guid), // TODO: Decide what to do about entries with *mixed* morph types
600+
// PrimaryMorphType is null if LexemeFormOA is null
601+
MorphType = entry.PrimaryMorphType is null
602+
? MorphType.Stem
603+
: LcmHelpers.FromLcmMorphTypeId(entry.PrimaryMorphType.Id.Guid), // TODO: Decide what to do about entries with *mixed* morph types
601604
Senses = entry.AllSenses.Select(FromLexSense).ToList(),
602605
ComplexFormTypes = ToComplexFormTypes(entry),
603606
Components = ToComplexFormComponents(entry).ToList(),

backend/FwLite/LcmCrdt/Changes/CreateEntryChange.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public override ValueTask<Entry> NewEntity(Commit commit, IChangeContext context
4343
CitationForm = CitationForm ?? new MultiString(),
4444
LiteralMeaning = LiteralMeaning ?? new(),
4545
Note = Note ?? new(),
46-
MorphType = MorphType ?? default
46+
MorphType = MorphType ?? MiniLcm.Models.MorphType.Stem,
4747
});
4848
}
4949
}

backend/FwLite/MiniLcm/Models/Entry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public record Entry : IObjectWithId<Entry>
1010
public virtual MultiString CitationForm { get; set; } = new();
1111

1212
public virtual RichMultiString LiteralMeaning { get; set; } = new();
13-
public virtual MorphType MorphType { get; set; }
13+
public virtual MorphType MorphType { get; set; } = MorphType.Stem;
1414
public virtual List<Sense> Senses { get; set; } = [];
1515

1616
public virtual RichMultiString Note { get; set; } = new();

0 commit comments

Comments
 (0)