File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change 11import csv
2+ from collections import defaultdict
23from collections .abc import Container
34from dataclasses import dataclass
45from datetime import datetime
@@ -250,20 +251,11 @@ def update_dicts(
250251 print (f"spoken_form_entries: { spoken_form_entries } " )
251252
252253 # Assign result to talon context list
253- assign_lists_to_context (
254- ctx ,
255- {
256- list_name : {
257- spoken_form : entry .id
258- for entry in spoken_form_entries
259- for spoken_form in entry .spoken_forms
260- }
261- for list_name , spoken_form_entries in groupby (
262- spoken_form_entries , key = lambda x : x .list_name
263- )
264- },
265- pluralize_lists ,
266- )
254+ lists : ListToSpokenForms = defaultdict (dict )
255+ for entry in spoken_form_entries :
256+ for spoken_form in entry .spoken_forms :
257+ lists [entry .list_name ][spoken_form ] = entry .id
258+ assign_lists_to_context (ctx , lists , pluralize_lists )
267259
268260 if handle_new_values is not None :
269261 handle_new_values (spoken_form_entries )
You can’t perform that action at this time.
0 commit comments