Create new tokens and tuples from existing ones based on conditions
问题 This is very related to a previous question but I am having difficulties adapting for my use case. I have a sentence: "Forbes Asia 200 Best Under 500 Billion 2011" I have tokens like: oldTokens = [u'Forbes', u'Asia', u'200', u'Best', u'Under', u'500', u'Billion', u'2011'] And the indices of where a previous parser has figured out where there should be location or number slots: numberTokenIDs = {(7,): 2011.0, (2,): 200.0, (5,6): 500000000000.00} locationTokenIDs = {(0, 1): u'Forbes Asia'} The