Closed psfblair closed 4 years ago
Thanks.
By the way, speaking of computeIfAbsent
, the MemoTable.memoTable
field used to be a Map<Clause, NavigableMap<Integer, Match>>
, which mapped from memoKey.clause
to memoKey.startPos
to match
. I used computeIfAbsent
to create a new ConcurrentSkipList<Integer, Match>
for the inner maps if they didn't exist. With this data structure, it's very fast to find all neighboring matches of a given rule of interest. This might possibly be useful to you with your whitespace-sensitive parser.
Thanks!
Small changes that came up while I was working on the Kotlin version: 1) Add unicode escape instead of non-printing character; 2) Use computeIfAbsent for initializing map entries. (This could probably be done in other places as well, but it was near where I was fixing the non-printing character so I put it in.