files tree made better.

This commit is contained in:
Paul Schneider 2019-01-01 16:28:47 +00:00
commit ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions

View file

@ -0,0 +1,98 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Yavsc.Abstract.IT
{
public class CharArray : List<char>, IEnumerable<char>, IList<char>
{
public CharArray (char [] charArray) : base (charArray)
{
}
public CharArray (IList<char> word): base(word) {
}
public CharArray (IEnumerable<char> word): base(word) {
}
public IList<char> Aggregate(char other)
{
this.Add(other);
return this;
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
public class CodeFromChars : List<CharArray>, ICode<char>
{
public void AddLetter(IEnumerable<char> letter)
{
var candide = new CharArray(letter);
// TODO build new denied letters: compute the automate
// and check it is determinised
// Automate a = new Automate();
Add(candide);
}
public bool Validate()
{
// this is a n*n task
throw new NotImplementedException();
}
IEnumerator<IEnumerable<char>> IEnumerable<IEnumerable<char>>.GetEnumerator()
{
return GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
private class Automate
{
int State { get; set; }
Dictionary<int, Dictionary<int,int>> Transitions { get; set; }
CodeFromChars Code { get; set; }
void Compute(CharArray chars)
{
if (!Code.Contains(chars)) {
State = -1;
return;
}
if (!Transitions.ContainsKey(State)) {
State = -2;
return;
}
var states = Transitions[State];
int letter = Code.IndexOf(chars);
if (!states.ContainsKey(letter))
{
State = -3;
return;
}
State = states[letter];
}
}
}
}

View file

@ -0,0 +1,24 @@
using System.Collections.Generic;
namespace Yavsc.Abstract.IT
{
// un code est, parmis les ensembles de suites de signes,
// ceux qui n'ont qu'une seule suite de suites pouvant représenter toute suite de suite de signes
public interface ICode<TSign> : IEnumerable<IEnumerable<TSign>>
{
/// <summary>
/// Checks false that a letter list combinaison correspond to another one
/// </summary>
/// <returns></returns>
bool Validate();
/// <summary>
/// Defines a new letter in this code,
/// as an enumerable of <c>TLetter</c>
/// </summary>
/// <param name="letter"></param>
/// <returns></returns>
void AddLetter(IEnumerable<TSign> letter);
}
}

View file

@ -0,0 +1,14 @@
using System.Collections.Generic;
namespace Yavsc.Abstract.IT
{
public interface IProject
{
long Id { get; set ; }
string OwnerId { get; set; }
string Name { get; set; }
string Version { get; set; }
IEnumerable<string> GetConfigurations();
}
}