@@ -85,62 +85,62 @@ internal static bool SearchValue(this ITsMultiString multiString, string value)
8585 '\u0640 ' , // Arabic Tatweel
8686 ] ;
8787
88- internal static MorphType FromLcmMorphType ( IMoMorphType ? morphType )
88+ internal static MorphTypeKind FromLcmMorphType ( IMoMorphType ? morphType )
8989 {
9090 var lcmMorphTypeId = morphType ? . Id . Guid ;
9191
9292 return lcmMorphTypeId switch
9393 {
94- null => MorphType . Unknown ,
94+ null => MorphTypeKind . Unknown ,
9595 // Can't switch on Guids since they're not compile-type constants, but thankfully pattern matching works
96- Guid g when g == MoMorphTypeTags . kguidMorphBoundRoot => MorphType . BoundRoot ,
97- Guid g when g == MoMorphTypeTags . kguidMorphBoundStem => MorphType . BoundStem ,
98- Guid g when g == MoMorphTypeTags . kguidMorphCircumfix => MorphType . Circumfix ,
99- Guid g when g == MoMorphTypeTags . kguidMorphClitic => MorphType . Clitic ,
100- Guid g when g == MoMorphTypeTags . kguidMorphEnclitic => MorphType . Enclitic ,
101- Guid g when g == MoMorphTypeTags . kguidMorphInfix => MorphType . Infix ,
102- Guid g when g == MoMorphTypeTags . kguidMorphParticle => MorphType . Particle ,
103- Guid g when g == MoMorphTypeTags . kguidMorphPrefix => MorphType . Prefix ,
104- Guid g when g == MoMorphTypeTags . kguidMorphProclitic => MorphType . Proclitic ,
105- Guid g when g == MoMorphTypeTags . kguidMorphRoot => MorphType . Root ,
106- Guid g when g == MoMorphTypeTags . kguidMorphSimulfix => MorphType . Simulfix ,
107- Guid g when g == MoMorphTypeTags . kguidMorphStem => MorphType . Stem ,
108- Guid g when g == MoMorphTypeTags . kguidMorphSuffix => MorphType . Suffix ,
109- Guid g when g == MoMorphTypeTags . kguidMorphSuprafix => MorphType . Suprafix ,
110- Guid g when g == MoMorphTypeTags . kguidMorphInfixingInterfix => MorphType . InfixingInterfix ,
111- Guid g when g == MoMorphTypeTags . kguidMorphPrefixingInterfix => MorphType . PrefixingInterfix ,
112- Guid g when g == MoMorphTypeTags . kguidMorphSuffixingInterfix => MorphType . SuffixingInterfix ,
113- Guid g when g == MoMorphTypeTags . kguidMorphPhrase => MorphType . Phrase ,
114- Guid g when g == MoMorphTypeTags . kguidMorphDiscontiguousPhrase => MorphType . DiscontiguousPhrase ,
115- _ => MorphType . Other ,
96+ Guid g when g == MoMorphTypeTags . kguidMorphBoundRoot => MorphTypeKind . BoundRoot ,
97+ Guid g when g == MoMorphTypeTags . kguidMorphBoundStem => MorphTypeKind . BoundStem ,
98+ Guid g when g == MoMorphTypeTags . kguidMorphCircumfix => MorphTypeKind . Circumfix ,
99+ Guid g when g == MoMorphTypeTags . kguidMorphClitic => MorphTypeKind . Clitic ,
100+ Guid g when g == MoMorphTypeTags . kguidMorphEnclitic => MorphTypeKind . Enclitic ,
101+ Guid g when g == MoMorphTypeTags . kguidMorphInfix => MorphTypeKind . Infix ,
102+ Guid g when g == MoMorphTypeTags . kguidMorphParticle => MorphTypeKind . Particle ,
103+ Guid g when g == MoMorphTypeTags . kguidMorphPrefix => MorphTypeKind . Prefix ,
104+ Guid g when g == MoMorphTypeTags . kguidMorphProclitic => MorphTypeKind . Proclitic ,
105+ Guid g when g == MoMorphTypeTags . kguidMorphRoot => MorphTypeKind . Root ,
106+ Guid g when g == MoMorphTypeTags . kguidMorphSimulfix => MorphTypeKind . Simulfix ,
107+ Guid g when g == MoMorphTypeTags . kguidMorphStem => MorphTypeKind . Stem ,
108+ Guid g when g == MoMorphTypeTags . kguidMorphSuffix => MorphTypeKind . Suffix ,
109+ Guid g when g == MoMorphTypeTags . kguidMorphSuprafix => MorphTypeKind . Suprafix ,
110+ Guid g when g == MoMorphTypeTags . kguidMorphInfixingInterfix => MorphTypeKind . InfixingInterfix ,
111+ Guid g when g == MoMorphTypeTags . kguidMorphPrefixingInterfix => MorphTypeKind . PrefixingInterfix ,
112+ Guid g when g == MoMorphTypeTags . kguidMorphSuffixingInterfix => MorphTypeKind . SuffixingInterfix ,
113+ Guid g when g == MoMorphTypeTags . kguidMorphPhrase => MorphTypeKind . Phrase ,
114+ Guid g when g == MoMorphTypeTags . kguidMorphDiscontiguousPhrase => MorphTypeKind . DiscontiguousPhrase ,
115+ // Non-canonical Guids should not be guessed, but be mapped to Unknown
116+ _ => MorphTypeKind . Unknown ,
116117 } ;
117118 }
118119
119- internal static Guid ? ToLcmMorphTypeId ( MorphType morphType )
120+ internal static Guid ? ToLcmMorphTypeId ( MorphTypeKind morphType )
120121 {
121122 return morphType switch
122123 {
123- MorphType . BoundRoot => MoMorphTypeTags . kguidMorphBoundRoot ,
124- MorphType . BoundStem => MoMorphTypeTags . kguidMorphBoundStem ,
125- MorphType . Circumfix => MoMorphTypeTags . kguidMorphCircumfix ,
126- MorphType . Clitic => MoMorphTypeTags . kguidMorphClitic ,
127- MorphType . Enclitic => MoMorphTypeTags . kguidMorphEnclitic ,
128- MorphType . Infix => MoMorphTypeTags . kguidMorphInfix ,
129- MorphType . Particle => MoMorphTypeTags . kguidMorphParticle ,
130- MorphType . Prefix => MoMorphTypeTags . kguidMorphPrefix ,
131- MorphType . Proclitic => MoMorphTypeTags . kguidMorphProclitic ,
132- MorphType . Root => MoMorphTypeTags . kguidMorphRoot ,
133- MorphType . Simulfix => MoMorphTypeTags . kguidMorphSimulfix ,
134- MorphType . Stem => MoMorphTypeTags . kguidMorphStem ,
135- MorphType . Suffix => MoMorphTypeTags . kguidMorphSuffix ,
136- MorphType . Suprafix => MoMorphTypeTags . kguidMorphSuprafix ,
137- MorphType . InfixingInterfix => MoMorphTypeTags . kguidMorphInfixingInterfix ,
138- MorphType . PrefixingInterfix => MoMorphTypeTags . kguidMorphPrefixingInterfix ,
139- MorphType . SuffixingInterfix => MoMorphTypeTags . kguidMorphSuffixingInterfix ,
140- MorphType . Phrase => MoMorphTypeTags . kguidMorphPhrase ,
141- MorphType . DiscontiguousPhrase => MoMorphTypeTags . kguidMorphDiscontiguousPhrase ,
142- MorphType . Unknown => null ,
143- MorphType . Other => null , // Note that this will not round-trip with FromLcmMorphType
124+ MorphTypeKind . BoundRoot => MoMorphTypeTags . kguidMorphBoundRoot ,
125+ MorphTypeKind . BoundStem => MoMorphTypeTags . kguidMorphBoundStem ,
126+ MorphTypeKind . Circumfix => MoMorphTypeTags . kguidMorphCircumfix ,
127+ MorphTypeKind . Clitic => MoMorphTypeTags . kguidMorphClitic ,
128+ MorphTypeKind . Enclitic => MoMorphTypeTags . kguidMorphEnclitic ,
129+ MorphTypeKind . Infix => MoMorphTypeTags . kguidMorphInfix ,
130+ MorphTypeKind . Particle => MoMorphTypeTags . kguidMorphParticle ,
131+ MorphTypeKind . Prefix => MoMorphTypeTags . kguidMorphPrefix ,
132+ MorphTypeKind . Proclitic => MoMorphTypeTags . kguidMorphProclitic ,
133+ MorphTypeKind . Root => MoMorphTypeTags . kguidMorphRoot ,
134+ MorphTypeKind . Simulfix => MoMorphTypeTags . kguidMorphSimulfix ,
135+ MorphTypeKind . Stem => MoMorphTypeTags . kguidMorphStem ,
136+ MorphTypeKind . Suffix => MoMorphTypeTags . kguidMorphSuffix ,
137+ MorphTypeKind . Suprafix => MoMorphTypeTags . kguidMorphSuprafix ,
138+ MorphTypeKind . InfixingInterfix => MoMorphTypeTags . kguidMorphInfixingInterfix ,
139+ MorphTypeKind . PrefixingInterfix => MoMorphTypeTags . kguidMorphPrefixingInterfix ,
140+ MorphTypeKind . SuffixingInterfix => MoMorphTypeTags . kguidMorphSuffixingInterfix ,
141+ MorphTypeKind . Phrase => MoMorphTypeTags . kguidMorphPhrase ,
142+ MorphTypeKind . DiscontiguousPhrase => MoMorphTypeTags . kguidMorphDiscontiguousPhrase ,
143+ MorphTypeKind . Unknown => null ,
144144 _ => null ,
145145 } ;
146146 }
@@ -212,47 +212,47 @@ internal static string PickText(this ICmObject obj, ITsMultiString multiString,
212212 return multiString . get_String ( wsHandle ) ? . Text ?? string . Empty ;
213213 }
214214
215- internal static IMoForm CreateLexemeForm ( this LcmCache cache , MorphType morphType )
215+ internal static IMoForm CreateLexemeForm ( this LcmCache cache , MorphTypeKind morphType )
216216 {
217217 return
218218 IsAffixMorphType ( morphType )
219219 ? cache . ServiceLocator . GetInstance < IMoAffixAllomorphFactory > ( ) . Create ( )
220220 : cache . ServiceLocator . GetInstance < IMoStemAllomorphFactory > ( ) . Create ( ) ;
221221 }
222222
223- internal static bool IsAffixMorphType ( MorphType morphType )
223+ internal static bool IsAffixMorphType ( MorphTypeKind morphType )
224224 {
225225 return morphType switch
226226 {
227227 // Affixes of all types should use the Affix morph type factory
228- MorphType . Circumfix => true ,
229- MorphType . Infix => true ,
230- MorphType . Prefix => true ,
231- MorphType . Simulfix => true ,
232- MorphType . Suffix => true ,
233- MorphType . Suprafix => true ,
234- MorphType . InfixingInterfix => true ,
235- MorphType . PrefixingInterfix => true ,
236- MorphType . SuffixingInterfix => true ,
228+ MorphTypeKind . Circumfix => true ,
229+ MorphTypeKind . Infix => true ,
230+ MorphTypeKind . Prefix => true ,
231+ MorphTypeKind . Simulfix => true ,
232+ MorphTypeKind . Suffix => true ,
233+ MorphTypeKind . Suprafix => true ,
234+ MorphTypeKind . InfixingInterfix => true ,
235+ MorphTypeKind . PrefixingInterfix => true ,
236+ MorphTypeKind . SuffixingInterfix => true ,
237237
238238 // Everything else should use the Stem morph type factory
239239 _ => false ,
240240 } ;
241241 }
242242
243- internal static ILexEntry CreateEntry ( this LcmCache cache , Guid id , MorphType morphType )
243+ internal static ILexEntry CreateEntry ( this LcmCache cache , Guid id , MorphTypeKind morphType )
244244 {
245245 var lexEntry = cache . ServiceLocator . GetInstance < ILexEntryFactory > ( ) . Create ( id ,
246246 cache . ServiceLocator . GetInstance < ILangProjectRepository > ( ) . Singleton . LexDbOA ) ;
247247 SetLexemeForm ( lexEntry , morphType , cache ) ;
248248 return lexEntry ;
249249 }
250250
251- internal static IMoForm SetLexemeForm ( ILexEntry lexEntry , MorphType morphType , LcmCache cache )
251+ internal static IMoForm SetLexemeForm ( ILexEntry lexEntry , MorphTypeKind morphType , LcmCache cache )
252252 {
253253 lexEntry . LexemeFormOA = cache . CreateLexemeForm ( morphType ) ;
254254 //must be done after the IMoForm is set on the LexemeForm property
255- var lcmMorphType = ToLcmMorphTypeId ( morphType ) ?? ToLcmMorphTypeId ( MorphType . Stem ) ;
255+ var lcmMorphType = ToLcmMorphTypeId ( morphType ) ?? ToLcmMorphTypeId ( MorphTypeKind . Stem ) ;
256256 lexEntry . LexemeFormOA . MorphTypeRA = cache . ServiceLocator . GetInstance < IMoMorphTypeRepository > ( ) . GetObject ( lcmMorphType ! . Value ) ;
257257 return lexEntry . LexemeFormOA ;
258258 }
0 commit comments