johnpaulbin commited on
Commit
fff5a8f
1 Parent(s): 2c6b6c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -45,10 +45,10 @@ spanish_words = set()
45
  for pair in json_data:
46
  if "english" in pair:
47
  # Extract words from the English sentence and filter out numbers
48
- english_words.update(filter(is_word, re.findall(r'\b\w+\b', pair["english"])))
49
  if "spanish" in pair:
50
  # Extract words from the Spanish sentence and filter out numbers
51
- spanish_words.update(filter(is_word, re.findall(r'\b\w+\b', pair["spanish"])))
52
 
53
  def get_distractors(target_word, all_words, num_distractors=3):
54
  """
 
45
  for pair in json_data:
46
  if "english" in pair:
47
  # Extract words from the English sentence and filter out numbers
48
+ english_words.update(filter(is_word, re.findall(r'\b\w+\b', pair.get("english", ""))))
49
  if "spanish" in pair:
50
  # Extract words from the Spanish sentence and filter out numbers
51
+ spanish_words.update(filter(is_word, re.findall(r'\b\w+\b', pair.get("spanish", ""))))
52
 
53
  def get_distractors(target_word, all_words, num_distractors=3):
54
  """