fix: get morph copy for all morph lists in analytics download (#1400)
This commit is contained in:
parent
075b3da80e
commit
47930eea1b
2 changed files with 15 additions and 3 deletions
|
|
@ -113,10 +113,11 @@ class AnalyticsSummaryModel {
|
|||
use.useType == ConstructUseTypeEnum.wa ||
|
||||
use.useType == ConstructUseTypeEnum.ga,
|
||||
percent: 0.8,
|
||||
context: context,
|
||||
);
|
||||
|
||||
correctSystemUseLemmas.addAll(originalWrittenUses.over);
|
||||
incorrectSystemUseLemmas.addAll(originalWrittenUses.under);
|
||||
correctOriginalUseLemmas.addAll(originalWrittenUses.over);
|
||||
incorrectOriginalUseLemmas.addAll(originalWrittenUses.under);
|
||||
|
||||
final systemGeneratedUses = morphLemmas.lemmasByPercent(
|
||||
filter: (use) =>
|
||||
|
|
@ -125,6 +126,7 @@ class AnalyticsSummaryModel {
|
|||
use.useType != ConstructUseTypeEnum.unk &&
|
||||
use.pointValue != 0,
|
||||
percent: 0.8,
|
||||
context: context,
|
||||
);
|
||||
|
||||
correctSystemUseLemmas.addAll(systemGeneratedUses.over);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/enum/construct_type_enum.dart';
|
||||
|
|
@ -7,6 +9,7 @@ import 'package:fluffychat/pangea/models/analytics/construct_use_model.dart';
|
|||
import 'package:fluffychat/pangea/models/analytics/constructs_model.dart';
|
||||
import 'package:fluffychat/pangea/models/practice_activities.dart/practice_activity_model.dart';
|
||||
import 'package:fluffychat/pangea/utils/error_handler.dart';
|
||||
import 'package:fluffychat/pangea/utils/grammar/get_grammar_copy.dart';
|
||||
|
||||
/// A wrapper around a list of [OneConstructUse]s, used to simplify
|
||||
/// the process of filtering / sorting / displaying the events.
|
||||
|
|
@ -263,16 +266,23 @@ class LemmasToUsesWrapper {
|
|||
LemmasOverUnderList lemmasByPercent({
|
||||
required bool Function(OneConstructUse) filter,
|
||||
required double percent,
|
||||
required BuildContext context,
|
||||
}) {
|
||||
final List<String> correctUseLemmas = [];
|
||||
final List<String> incorrectUseLemmas = [];
|
||||
|
||||
final uses = lemmasToFilteredUses(filter);
|
||||
for (final entry in uses.entries) {
|
||||
if (entry.value.isEmpty) continue;
|
||||
final List<OneConstructUse> correctUses = [];
|
||||
final List<OneConstructUse> incorrectUses = [];
|
||||
|
||||
final lemma = entry.key;
|
||||
final lemma = getGrammarCopy(
|
||||
category: entry.value.first.category,
|
||||
lemma: entry.key,
|
||||
context: context,
|
||||
) ??
|
||||
entry.key;
|
||||
final uses = entry.value.toList();
|
||||
|
||||
for (final use in uses) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue