I split the dialogue into two dictionaries, each of them contains words which the person say (i have 2 persons). I have to print 4 columns (keyword, number from first directory (how many times use that word first person), number from second directory and count of them) and order by keyword. Can somebody help me ? Output have to look like this:
african 1 0 1
air-speed 1 0 0
an 1 1 2
arthur 1 0 1
...
As you can see I have som text
text = """Bridgekeeper: Hee hee heh. Stop. What... is your name?
King Arthur: It is 'Arthur', King of the Britons.
Bridgekeeper: What... is your quest?
King Arthur: To seek the Holy Grail.
Bridgekeeper: What... is the air-speed velocity of an unladen swallow?
King Arthur: What do you mean? An African or European swallow?"""
Output of bridgekeeper_w and arthur_w:
print (bridgekeeper_w)
{'hee': 2, 'heh': 1, 'stop': 1, 'what': 3, 'is': 3, 'your': 2, 'name': 1, 'quest': 1, 'the': 1, 'air-speed': 1, 'velocity': 1, 'of': 1, 'an': 1, 'unladen': 1, 'swallow': 1}
print (arthur_w)
{'king': 4, 'it': 1, 'is': 1, 'arthur': 1, 'of': 1, 'the': 2, 'britons': 1, 'to': 1, 'seek': 1, 'holy': 1, 'grail': 1, 'what': 1, 'do': 1, 'you': 1, 'mean': 1, 'an': 1, 'african': 1, 'or': 1, 'european': 1, 'swallow': 1}
Now i need this (keyword, number from first dict, number from second dict, and count):
african 1 0 1
air-speed 1 0 0
an 1 1 2
arthur 1 0 1
...
``