MCPcopy Create free account
hub / github.com/Notgnoshi/generative / _tokenize_default

Method _tokenize_default

generative/lsystem/interpreter.py:54–62  ·  view source on GitHub ↗
(commands: io.TextIOWrapper)

Source from the content-addressed store, hash-verified

52
53 @staticmethod
54 def _tokenize_default(commands: io.TextIOWrapper) -> Tokens:
55 # The default set of commands are each a single character.
56 # So tokenizing is really easy. Yay.
57 while True:
58 chunk = commands.read(256)
59 if not chunk:
60 break
61 for char in chunk:
62 yield char
63
64 def interpret(self, tokens: Tokens) -> Lines:
65 """Interpret the given tokens as 3D Turtle commands."""

Callers 1

tokenizeMethod · 0.95

Calls 1

readMethod · 0.80

Tested by

no test coverage detected