fix: update morph feature sort order (#1796)
This commit is contained in:
parent
f296012a0e
commit
91ab045365
2 changed files with 40 additions and 40 deletions
|
|
@ -31,7 +31,7 @@ class MorphAnalyticsView extends StatelessWidget {
|
|||
builder: (context, snapshot) {
|
||||
final morphs = snapshot.data ?? defaultMorphMapping;
|
||||
|
||||
morphs.displayFeatures.sort(
|
||||
final features = morphs.displayFeatures.sorted(
|
||||
(a, b) => morphFeatureSortOrder
|
||||
.indexOf(a.feature)
|
||||
.compareTo(morphFeatureSortOrder.indexOf(b.feature)),
|
||||
|
|
@ -40,21 +40,21 @@ class MorphAnalyticsView extends StatelessWidget {
|
|||
return snapshot.connectionState == ConnectionState.done
|
||||
? ListView.builder(
|
||||
key: const PageStorageKey<String>('morph-analytics'),
|
||||
itemCount: morphs.displayFeatures.length,
|
||||
itemBuilder: (context, index) => morphs
|
||||
.displayFeatures[index].displayTags.isNotEmpty
|
||||
? MorphFeatureBox(
|
||||
morphFeature: morphs.displayFeatures[index].feature,
|
||||
allTags: snapshot.data
|
||||
?.getDisplayTags(
|
||||
morphs.displayFeatures[index].feature,
|
||||
)
|
||||
.map((tag) => tag.toLowerCase())
|
||||
.toSet() ??
|
||||
{},
|
||||
onConstructZoom: onConstructZoom,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
itemCount: features.length,
|
||||
itemBuilder: (context, index) =>
|
||||
features[index].displayTags.isNotEmpty
|
||||
? MorphFeatureBox(
|
||||
morphFeature: features[index].feature,
|
||||
allTags: snapshot.data
|
||||
?.getDisplayTags(
|
||||
features[index].feature,
|
||||
)
|
||||
.map((tag) => tag.toLowerCase())
|
||||
.toSet() ??
|
||||
{},
|
||||
onConstructZoom: onConstructZoom,
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
)
|
||||
: const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
|
|
|
|||
|
|
@ -235,33 +235,33 @@ 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",
|
||||
"aspect",
|
||||
"mood",
|
||||
"voice",
|
||||
"verbform",
|
||||
"verbtype",
|
||||
"voice",
|
||||
"number",
|
||||
"gender",
|
||||
"nountype",
|
||||
"case",
|
||||
"prontype",
|
||||
"person",
|
||||
"definite",
|
||||
"reflex",
|
||||
"prepcase",
|
||||
"poss",
|
||||
"number[psor]",
|
||||
"degree",
|
||||
"polarity",
|
||||
"advtype",
|
||||
"conjtype",
|
||||
"numform",
|
||||
"numtype",
|
||||
"polite",
|
||||
"puncttype",
|
||||
"punctside",
|
||||
"evident",
|
||||
"foreign",
|
||||
"x",
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue