Its control flow was confusing before; now it's much more straightforward. We make a string representing classes of words, split that by a regular expression for number words, then parse each number and build up our return string and list. It works just as well as the previous method, is a bit shorter, and I feel that it's clearer as well.
|
|
||
139 |
|
139 |
|
140 |
|
140 |
|
141 |
|
141 |
|
142 |
|
|
|
143 |
|
142 |
|
144 |
|
143 |
|
145 |
|
|
|
146 |
|
|
|
|
144 |
|
|
|
145 |
|
|
|
146 |
|
|
147 |
|
147 |
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
|
|
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
|
|
148 |
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
|
|
162 |
|
152 |
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
166 |
|
161 |
|
167 |
|
|
|
|
162 |
|
|
168 |
|
163 |
|
169 |
|
164 |
|
170 |
|
|
|
171 |
|
|
|
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
172 |
|
169 |
|
173 |
|
170 |
|
174 |
|
171 |
|
175 |
|
172 |
|
176 |
|
173 |
|
177 |
|
174 |
|
178 |
|
|
|
|
175 |
|
|
179 |
|
176 |
|
180 |
|
177 |
|
181 |
|
178 |
|
182 |
|
|
|
|
179 |
|