Mercurial > pub > ImplabNet
comparison Implab/Automaton/IndexedAlphabetBase.cs @ 180:c32688129f14 ref20160224
refactoring complete, JSONParser rewritten
| author | cin |
|---|---|
| date | Thu, 24 Mar 2016 02:30:46 +0300 |
| parents | 0c3c69fe225b |
| children |
comparison
equal
deleted
inserted
replaced
| 179:478ef706906a | 180:c32688129f14 |
|---|---|
| 28 /// in the map is the last classified symbol in the alphabet, i.e. the map can be | 28 /// in the map is the last classified symbol in the alphabet, i.e. the map can be |
| 29 /// shorter then the whole alphabet. | 29 /// shorter then the whole alphabet. |
| 30 /// </remarks> | 30 /// </remarks> |
| 31 /// <returns>The translation map.</returns> | 31 /// <returns>The translation map.</returns> |
| 32 public int[] GetTranslationMap() { | 32 public int[] GetTranslationMap() { |
| 33 Dictionary<int,int> map = new Dictionary<int, int>(); | 33 var map = new Dictionary<int, int>(); |
| 34 | 34 |
| 35 int max; | 35 int max = 0; |
| 36 foreach (var p in Mappings) { | 36 foreach (var p in Mappings) { |
| 37 var index = GetSymbolIndex(p.Key); | 37 var index = GetSymbolIndex(p.Key); |
| 38 max = Math.Max(max, index); | 38 max = Math.Max(max, index); |
| 39 map[index] = p.Value; | 39 map[index] = p.Value; |
| 40 } | 40 } |
