MIREParse/fileshare/files/MIParser-stable.py
def addUDHash(self, entry):
		"""Adds to the left and right hash tables."""
		# create the token-token left table
		if self.myData.totoLeft.has_key(entry[0]):
			if entry[2] in self.myData.totoLeft[entry[0]]:
				self.myData.totoLeft[entry[0]][0] += 1
			else:
				self.myData.totoLeft[entry[0]][0] += 1
				self.myData.totoLeft[entry[0]][1].append(entry[2])
		else:
			self.myData.totoLeft[entry[0]] = [ 1, [ entry[2] ] ]

		# create the token-type left table
		if self.myData.totyLeft.has_key(entry[0]):
			if entry[3] in self.myData.totyLeft[entry[0]]:
				self.myData.totyLeft[entry[0]][0] += 1
			else:
				self.myData.totyLeft[entry[0]][0] += 1
				self.myData.totyLeft[entry[0]][1].append(entry[3])
		else:
			self.myData.totyLeft[entry[0]] = [ 1, [ entry[3] ] ]

		# create the type-token left table
		if self.myData.tytoLeft.has_key(entry[1]):
			if entry[2] in self.myData.tytoLeft[entry[1]]:
				self.myData.tytoLeft[entry[1]][0] += 1
			else:
				self.myData.tytoLeft[entry[1]][0] += 1
				self.myData.tytoLeft[entry[1]][1].append(entry[2])
		else:
			self.myData.tytoLeft[entry[1]] = [ 1, [ entry[2] ] ]

		# create the type-type left table
		if self.myData.tytyLeft.has_key(entry[1]):
			if entry[3] in self.myData.tytyLeft[entry[1]]:
				self.myData.tytyLeft[entry[1]][0] += 1
			else:
				self.myData.tytyLeft[entry[1]][0] += 1
				self.myData.tytyLeft[entry[1]][1].append(entry[3])
		else:
			self.myData.tytyLeft[entry[1]] = [ 1, [ entry[3] ] ]

		# create the token-token right table
		if self.myData.totoRight.has_key(entry[2]):
			if entry[0] in self.myData.totoRight[entry[2]]:
				self.myData.totoRight[entry[2]][0] += 1
			else:
				self.myData.totoRight[entry[2]][0] += 1
				self.myData.totoRight[entry[2]][1].append(entry[0])
		else:
			self.myData.totoRight[entry[2]] = [ 1, [ entry[0] ] ]

		# create the token-type right table
		if self.myData.totyRight.has_key(entry[3]):
			if entry[0] in self.myData.totyRight[entry[3]]:
				self.myData.totyRight[entry[3]][0] += 1
			else:
				self.myData.totyRight[entry[3]][0] += 1
				self.myData.totyRight[entry[3]][1].append(entry[0])
		else:
			self.myData.totyRight[entry[3]] = [ 1, [ entry[0] ] ]

		# create the type-token right table
		if self.myData.tytoRight.has_key(entry[2]):
			if entry[1] in self.myData.tytoRight[entry[2]]:
				self.myData.tytoRight[entry[2]][0] += 1
			else:
				self.myData.tytoRight[entry[2]][0] += 1
				self.myData.tytoRight[entry[2]][1].append(entry[1])
		else:
			self.myData.tytoRight[entry[2]] = [ 1, [ entry[1] ] ]

		# create the type-type right table
		if self.myData.tytyRight.has_key(entry[3]):
			if entry[1] in self.myData.tytyRight[entry[3]]:
				self.myData.tytyRight[entry[3]][0] += 1
			else:
				self.myData.tytyRight[entry[3]][0] += 1
				self.myData.tytyRight[entry[3]][1].append(entry[1])
		else:
			self.myData.tytyRight[entry[3]] = [ 1, [ entry[1] ] ]
Adds to the left and right hash tables.
Adds to the left and right hash tables.
Adds to the left and right hash tables .
def addUDHash(self, entry):
		if self.myData.totoLeft.has_key(entry[0]):
			if entry[2] in self.myData.totoLeft[entry[0]]:
				self.myData.totoLeft[entry[0]][0] += 1
			else:
				self.myData.totoLeft[entry[0]][0] += 1
				self.myData.totoLeft[entry[0]][1].append(entry[2])
		else:
			self.myData.totoLeft[entry[0]] = [ 1, [ entry[2] ] ]
		if self.myData.totyLeft.has_key(entry[0]):
			if entry[3] in self.myData.totyLeft[entry[0]]:
				self.myData.totyLeft[entry[0]][0] += 1
			else:
				self.myData.totyLeft[entry[0]][0] += 1
				self.myData.totyLeft[entry[0]][1].append(entry[3])
		else:
			self.myData.totyLeft[entry[0]] = [ 1, [ entry[3] ] ]
		if self.myData.tytoLeft.has_key(entry[1]):
			if entry[2] in self.myData.tytoLeft[entry[1]]:
				self.myData.tytoLeft[entry[1]][0] += 1
			else:
				self.myData.tytoLeft[entry[1]][0] += 1
				self.myData.tytoLeft[entry[1]][1].append(entry[2])
		else:
			self.myData.tytoLeft[entry[1]] = [ 1, [ entry[2] ] ]
		if self.myData.tytyLeft.has_key(entry[1]):
			if entry[3] in self.myData.tytyLeft[entry[1]]:
				self.myData.tytyLeft[entry[1]][0] += 1
			else:
				self.myData.tytyLeft[entry[1]][0] += 1
				self.myData.tytyLeft[entry[1]][1].append(entry[3])
		else:
			self.myData.tytyLeft[entry[1]] = [ 1, [ entry[3] ] ]
		if self.myData.totoRight.has_key(entry[2]):
			if entry[0] in self.myData.totoRight[entry[2]]:
				self.myData.totoRight[entry[2]][0] += 1
			else:
				self.myData.totoRight[entry[2]][0] += 1
				self.myData.totoRight[entry[2]][1].append(entry[0])
		else:
			self.myData.totoRight[entry[2]] = [ 1, [ entry[0] ] ]
		if self.myData.totyRight.has_key(entry[3]):
			if entry[0] in self.myData.totyRight[entry[3]]:
				self.myData.totyRight[entry[3]][0] += 1
			else:
				self.myData.totyRight[entry[3]][0] += 1
				self.myData.totyRight[entry[3]][1].append(entry[0])
		else:
			self.myData.totyRight[entry[3]] = [ 1, [ entry[0] ] ]
		if self.myData.tytoRight.has_key(entry[2]):
			if entry[1] in self.myData.tytoRight[entry[2]]:
				self.myData.tytoRight[entry[2]][0] += 1
			else:
				self.myData.tytoRight[entry[2]][0] += 1
				self.myData.tytoRight[entry[2]][1].append(entry[1])
		else:
			self.myData.tytoRight[entry[2]] = [ 1, [ entry[1] ] ]
		if self.myData.tytyRight.has_key(entry[3]):
			if entry[1] in self.myData.tytyRight[entry[3]]:
				self.myData.tytyRight[entry[3]][0] += 1
			else:
				self.myData.tytyRight[entry[3]][0] += 1
				self.myData.tytyRight[entry[3]][1].append(entry[1])
		else:
			self.myData.tytyRight[entry[3]] = [ 1, [ entry[1] ] ]
def addUDHash ( self , entry ) : if self . myData . totoLeft . has_key ( entry [ 0 ] ) : if entry [ 2 ] in self . myData . totoLeft [ entry [ 0 ] ] : self . myData . totoLeft [ entry [ 0 ] ] [ 0 ] += 1 else : self . myData . totoLeft [ entry [ 0 ] ] [ 0 ] += 1 self . myData . totoLeft [ entry [ 0 ] ] [ 1 ] . append ( entry [ 2 ] ) else : self . myData . totoLeft [ entry [ 0 ] ] = [ 1 , [ entry [ 2 ] ] ] if self . myData . totyLeft . has_key ( entry [ 0 ] ) : if entry [ 3 ] in self . myData . totyLeft [ entry [ 0 ] ] : self . myData . totyLeft [ entry [ 0 ] ] [ 0 ] += 1 else : self . myData . totyLeft [ entry [ 0 ] ] [ 0 ] += 1 self . myData . totyLeft [ entry [ 0 ] ] [ 1 ] . append ( entry [ 3 ] ) else : self . myData . totyLeft [ entry [ 0 ] ] = [ 1 , [ entry [ 3 ] ] ] if self . myData . tytoLeft . has_key ( entry [ 1 ] ) : if entry [ 2 ] in self . myData . tytoLeft [ entry [ 1 ] ] : self . myData . tytoLeft [ entry [ 1 ] ] [ 0 ] += 1 else : self . myData . tytoLeft [ entry [ 1 ] ] [ 0 ] += 1 self . myData . tytoLeft [ entry [ 1 ] ] [ 1 ] . append ( entry [ 2 ] ) else : self . myData . tytoLeft [ entry [ 1 ] ] = [ 1 , [ entry [ 2 ] ] ] if self . myData . tytyLeft . has_key ( entry [ 1 ] ) : if entry [ 3 ] in self . myData . tytyLeft [ entry [ 1 ] ] : self . myData . tytyLeft [ entry [ 1 ] ] [ 0 ] += 1 else : self . myData . tytyLeft [ entry [ 1 ] ] [ 0 ] += 1 self . myData . tytyLeft [ entry [ 1 ] ] [ 1 ] . append ( entry [ 3 ] ) else : self . myData . tytyLeft [ entry [ 1 ] ] = [ 1 , [ entry [ 3 ] ] ] if self . myData . totoRight . has_key ( entry [ 2 ] ) : if entry [ 0 ] in self . myData . totoRight [ entry [ 2 ] ] : self . myData . totoRight [ entry [ 2 ] ] [ 0 ] += 1 else : self . myData . totoRight [ entry [ 2 ] ] [ 0 ] += 1 self . myData . totoRight [ entry [ 2 ] ] [ 1 ] . append ( entry [ 0 ] ) else : self . myData . totoRight [ entry [ 2 ] ] = [ 1 , [ entry [ 0 ] ] ] if self . myData . totyRight . has_key ( entry [ 3 ] ) : if entry [ 0 ] in self . myData . totyRight [ entry [ 3 ] ] : self . myData . totyRight [ entry [ 3 ] ] [ 0 ] += 1 else : self . myData . totyRight [ entry [ 3 ] ] [ 0 ] += 1 self . myData . totyRight [ entry [ 3 ] ] [ 1 ] . append ( entry [ 0 ] ) else : self . myData . totyRight [ entry [ 3 ] ] = [ 1 , [ entry [ 0 ] ] ] if self . myData . tytoRight . has_key ( entry [ 2 ] ) : if entry [ 1 ] in self . myData . tytoRight [ entry [ 2 ] ] : self . myData . tytoRight [ entry [ 2 ] ] [ 0 ] += 1 else : self . myData . tytoRight [ entry [ 2 ] ] [ 0 ] += 1 self . myData . tytoRight [ entry [ 2 ] ] [ 1 ] . append ( entry [ 1 ] ) else : self . myData . tytoRight [ entry [ 2 ] ] = [ 1 , [ entry [ 1 ] ] ] if self . myData . tytyRight . has_key ( entry [ 3 ] ) : if entry [ 1 ] in self . myData . tytyRight [ entry [ 3 ] ] : self . myData . tytyRight [ entry [ 3 ] ] [ 0 ] += 1 else : self . myData . tytyRight [ entry [ 3 ] ] [ 0 ] += 1 self . myData . tytyRight [ entry [ 3 ] ] [ 1 ] . append ( entry [ 1 ] ) else : self . myData . tytyRight [ entry [ 3 ] ] = [ 1 , [ entry [ 1 ] ] ]
Adds to the left and right hash tables.
Adds to the left and right hash tables .
"""Adds to the left and right hash tables.""" # create the token-token left table # create the token-type left table # create the type-token left table # create the type-type left table # create the token-token right table # create the token-type right table # create the type-token right table # create the type-type right table
self
entry