- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
public static List<string[]> Compose(List<string> list_eng, List<string> list_tar, string divider = ";")
{
List<string[]> composed = new List<string[]>();
for (int i = 0; i < list_eng.Count - 1; i++)
{
string[] tokens = new string[3];
string[] temp = list_eng[i].Split(new string[] { divider }, StringSplitOptions.None);
if (temp.Length != 2)
{
Console.WriteLine("1." + i + " : expected 2 tokens, found " + temp.Length);
continue;
}
tokens[0] = temp[0];
tokens[1] = temp[1];
composed.Add(tokens);
}
for (int i = 0; i < list_tar.Count - 1; i++)
{
string[] tokens = list_tar[i].Split(new string[] { divider }, StringSplitOptions.None);
if (tokens.Length != 2)
{
Console.WriteLine("2." + i + " : expected 2 tokens, found " + tokens.Length);
continue;
}
int eq = composed.FindIndex(a => a[0] == tokens[0]);
if (eq == -1)
continue;
else
composed[eq][2] = tokens[1];
}
return composed;
}