You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,13 +8,14 @@ import {getActiveCategory, State, advanceDot} from "./chart/state";
8
8
* Handles a token scanned from the input string.
9
9
*
10
10
* @param tokenPosition The start index of the scan.
11
-
* @param token The token that was scanned.
11
+
* @param word
12
+
* @param types
12
13
* //@param scanProbability Function that provides the probability of scanning the given token at this position. Might be null for a probability of 1.0.
13
14
* @param sr
14
15
* @param stateSets
15
16
*/
16
17
exportfunctionscan<S,T>(tokenPosition: number,
17
-
token: T,
18
+
{word, types}: WordWithTypes<T>,
18
19
// scanProbability:(x:T)=>number,//TODO
19
20
sr: Semiring<S>,
20
21
stateSets: Chart<T,S>){
@@ -27,13 +28,14 @@ export function scan<S, T>(tokenPosition: number,
27
28
* Get all states that are active on a terminal
28
29
* O(|stateset(i)|) = O(|grammar|): For all states <code>i: X<sub>k</sub> → λ·tμ</code>, where t is a terminal that matches the given token...
if(isNonTerminal(activeCategory))thrownewError("this is a bug");
35
-
else{
36
-
if(activeCategory(token)){// TODO can this be more efficient, ie have tokens make their category be explicit? (Do we want to maintain the possibility of such "fluid" categories?)
// TODO can this be more efficient, ie have tokens make their category be explicit? (Do we want to maintain the possibility of such "fluid" categories?)
37
39
// Create the chart <code>i+1: X<sub>k</sub> → λt·μ</code>
0 commit comments