<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addPattern(self, word, vector):
 """ Adds a pattern with key word. Example: net.addPattern("tom", [0, 0, 0, 1]) """

        if word in self.patterns:
            raise NetworkError('Pattern key already in use. Call delPattern to free key.', word)
        else:
            self.patterns[word] = vector