| 11 | |
| 12 | @attr.s |
| 13 | class NL2CodeEncoderState: |
| 14 | state = attr.ib() |
| 15 | memory = attr.ib() |
| 16 | words = attr.ib() |
| 17 | |
| 18 | def find_word_occurrences(self, word): |
| 19 | return [i for i, w in enumerate(self.words) if w == word] |
| 20 | |
| 21 | |
| 22 | @registry.register('encoder', 'NL2Code') |