/// <summary> /// Creates a new LALR parser. /// </summary> /// <param name="tokenizer">A tokenizer.</param> /// <param name="states">The LALR states.</param> /// <param name="startState">The starting state.</param> /// <param name="symbols"></param> public LALRParser(IStringTokenizer tokenizer, StateCollection states, State startState, SymbolCollection symbols) { this.tokenizer = tokenizer; this.states = states; this.startState = startState; this.symbols = symbols; storeTokens = StoreTokensMode.NoUserObject; }
/// <summary> /// Creates a new LALR parser. /// </summary> /// <param name="tokenizer">A tokenizer.</param> /// <param name="states">The LALR states.</param> /// <param name="startState">The starting state.</param> public LALRParser(IStringTokenizer tokenizer, StateCollection states, State startState) { this.tokenizer = tokenizer; this.states = states; this.startState = startState; this.trimReductions = trimReductions; storeTokens = StoreTokensMode.NoUserObject; }
/// <summary> /// Gets the tokenizer with the specified ID and all its filters. /// </summary> /// <param name="id">The tokenizer identifier.</param> /// <returns>The tokenizer with the filters from the specified chain. /// </returns> /// <exception cref="ArgumentNullException">tokenizerId</exception> public IStringTokenizer GetTokenizer(string id) { if (id == null) { throw new ArgumentNullException(nameof(id)); } IConfigurationSection section = Configuration.GetSection("Tokenizers"); if (!section.Exists()) { return(null); } int index = 0; foreach (IConfigurationSection tokSection in section.GetChildren()) { // Tokenizer/Id if (tokSection["Id"] == id) { // Tokenizer/TypeId, Options, FilterChain string typeId = tokSection["TypeId"]; IStringTokenizer tokenizer = GetComponent <IStringTokenizer>( typeId, $"Tokenizers:{index}:Options", true); if (tokenizer == null) { return(null); } string chainId = tokSection["FilterChain"]; if (!string.IsNullOrEmpty(chainId)) { tokenizer.Filter = new CompositeTextFilter( GetTextFilters(chainId)?.ToArray()); } return(tokenizer); } index++; } return(null); }
public FlickrNounResolver(IStringTokenizer tokenizer) { Tokenizer = tokenizer; }
public FlickrQueryStringResolver(IStringTokenizer tokenizer) { _tokenizer = tokenizer; }
public FlickrVerbResolver(IStringTokenizer tokenizer) { Tokenizer = tokenizer; }
public DefaultVerbResolver(IStringTokenizer tokenizer) { Tokenizer = tokenizer; }
public DefaultNounResolver(IStringTokenizer tokenizer) { PredefinedUrls = new Dictionary<string, string>(); Tokenizer = tokenizer; }
public DefaultQueryStringResolver(IStringTokenizer tokenizer) { Tokenizer = tokenizer; }
public DefaultNounResolver(IStringTokenizer tokenizer) { PredefinedUrls = new Dictionary <string, string>(); Tokenizer = tokenizer; }