diff --git a/test_parser.py b/test_parser.py index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d87829c986f8beb5fa4807a0cfe47b9a140c8da9 100644 --- a/test_parser.py +++ b/test_parser.py @@ -0,0 +1,12 @@ +def valid(): + parsedInput = input.preprocess().tokenise().parse() + return parsedInput.isValid() + # should also correctly identify each token as (in order) + +input = "beat the butter and sugar with an electric whisk until well combined" +valid(input) +# input: beat the butter and sugar with an electric whisk until well combined +# parsed: verb article ingredient conjunction ingredient preposition article utensil preposition adverb verb + +# input: To make the buttercream, beat the butter, icing sugar and vanilla with an electric whisk until pale and creamy +# parsed: preposition verb article mixture verb article ingredient ingredient conjunction ingredient preposition article utensil preposition adjective conjunction adjective