Skip to content

Getting a word from the lexicon, then adding a feature, causes that feature to be present if the same word is then got from the lexicon again. #17

Description

@GoogleCodeExporter
WordElement tree1 = lexicon.getWord("tree");
System.out.println(realiser.realise(tree1));  // tree

tree1.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
System.out.println(realiser.realise(tree1)); // trees

WordElement tree2 = lexicon.getWord("tree");
System.out.println(realiser.realise(tree2)); // trees

The solution would be to make a copy of the word when retrieving from the 
lexicon, rather than use the original. Note that this isn't picked up in the 
unit tests because the lexicon is created fresh for each test, rather than 
recycled. 

Original issue reported on code.google.com by o...@steamshift.net on 28 Feb 2012 at 6:17

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions