feat: custom sort order for morph features (#1794)
This commit is contained in:
parent
a0ef9c4424
commit
918c3193af
2 changed files with 39 additions and 0 deletions
|
|
@ -31,6 +31,12 @@ class MorphAnalyticsView extends StatelessWidget {
|
|||
builder: (context, snapshot) {
|
||||
final morphs = snapshot.data ?? defaultMorphMapping;
|
||||
|
||||
morphs.displayFeatures.sort(
|
||||
(a, b) => morphFeatureSortOrder
|
||||
.indexOf(a.feature)
|
||||
.compareTo(morphFeatureSortOrder.indexOf(b.feature)),
|
||||
);
|
||||
|
||||
return snapshot.connectionState == ConnectionState.done
|
||||
? ListView.builder(
|
||||
key: const PageStorageKey<String>('morph-analytics'),
|
||||
|
|
|
|||
|
|
@ -232,3 +232,36 @@ final MorphFeaturesAndTags defaultMorphMapping = MorphFeaturesAndTags.fromJson({
|
|||
}
|
||||
],
|
||||
});
|
||||
|
||||
final List<String> morphFeatureSortOrder = [
|
||||
"pos",
|
||||
"advtype",
|
||||
"aspect",
|
||||
"case",
|
||||
"conjtype",
|
||||
"definite",
|
||||
"degree",
|
||||
"evident",
|
||||
"gender",
|
||||
"mood",
|
||||
"nountype",
|
||||
"numform",
|
||||
"numtype",
|
||||
"number",
|
||||
"number[psor]",
|
||||
"person",
|
||||
"polarity",
|
||||
"polite",
|
||||
"poss",
|
||||
"prepcase",
|
||||
"prontype",
|
||||
"punctside",
|
||||
"puncttype",
|
||||
"reflex",
|
||||
"tense",
|
||||
"verbform",
|
||||
"verbtype",
|
||||
"voice",
|
||||
"foreign",
|
||||
"x",
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue