CentreForDigitalHumanities / parseport

Dutch sentence parser for Spindle + Æthel (and maybe others in the future).
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Optimise Aethel search code #46

Open XanderVertegaal opened 3 months ago

XanderVertegaal commented 3 months ago

The search logic in AethelQueryView.get() works but is not fully optimized. Instead of doing this (in lines 106ff.)

  # Check whether we have already added this sample for this result
  existing_sample = next(
      (s for s in result.samples if s.name == sample.name),
      None,
  )

it is worth investigating if we can keep track of the sample earlier in the for loop.