Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/IGrammar.cs @ 11659

Last change on this file since 11659 was 11659, checked in by gkronber, 9 years ago

#2283 initial import of implementation of grammatical optimization problem instances

File size: 906 bytes
Line 
1using System;
2using System.Collections.Generic;
3
4namespace HeuristicLab.Problems.GrammaticalOptimization {
5
6  // symbols are characters, possible nonterminal symbols are : 'A'..'Z'
7  // phrases and sentences are strings
8  // each symbol is only on element in a string
9
10  public interface IGrammar {
11    char SentenceSymbol { get; }
12    IEnumerable<char> NonTerminalSymbols { get; }
13    IEnumerable<char> TerminalSymbols { get; }
14    IEnumerable<char> Symbols { get; }
15
16    IEnumerable<string> GetAlternatives(char nt);
17    IEnumerable<string> GetTerminalAlternatives(char nt);
18    IEnumerable<string> GetNonTerminalAlternatives(char nt);
19
20    int MinPhraseLength(string phrase);
21    int MaxPhraseLength(string phrase);
22    string CompleteSentenceRandomly(Random random, string phrase, int maxLen);
23
24    bool IsTerminal(char symbol);
25    bool IsNonTerminal(char symbol);
26  }
27}
Note: See TracBrowser for help on using the repository browser.