print("Changing tag:")

w1.setName("NewTag")

print(w1.makeString())

fs = w1.getFeatureStructures().getAltFSValue(0)

print(fs.makeString())

print("Changing attribute value:")

fs.setAttributeValue("poslcat", "nnp")

print(fs.makeString())

print("Querying the story:")

query = gateway.createQuery("C.t~'JJ'")

qmap = story.getMatchingValues(query)

print str(len(qmap)) + " Matches found"

for k,v in qmap.items():
	print(k.toString())
	print(v)


print(w1.makeString())

print("Changing tag:")

w1.setName("NewTag")

print(w1.makeString())

fs = w1.getFeatureStructures().getAltFSValue(0)

print(fs.makeString())

print("Changing attribute value:")

fs.setAttributeValue("poslcat", "nnp")

print(fs.makeString())

print("Querying the story:")

query = gateway.createQuery("C.t~'JJ'")

qmap = story.getMatchingValues(query)

print str(len(qmap)) + " Matches found"

for k, v in qmap.items():
    print(k.toString())
    print(v)