<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def constraint(self, word):
 """ Returns the constraint that matches the given Word, or None. """

        if word.index in self._map1:
            return self._map1[word.index]