Refactor: Rename lookup dictionaries to thesaurus.

This prevents confusion with the .NET term 'dictionary'.
This commit is contained in:
Daniel Kraus 2015-07-14 23:50:39 +02:00
parent b810cc8a74
commit b421279208
18 changed files with 63 additions and 63 deletions

View File

@ -71,7 +71,7 @@ Die Lauris-Ausgabe wird in folgende Einheiten aufgetrennt:
strukturierter Form zur Verfügung.
## Kanonische Namen, Materialarten, Wörterbücher
## Kanonische Namen, Materialarten, Thesauri
Die Bezeichnungen für einzelne Parameter und Einheiten sind bei Lauris
teilweise etwas unglücklich. Beispielsweise wird `glomerul.
@ -81,20 +81,20 @@ sagen und schreiben. Die Einheit `ml/min /1,73qm` enthält ein
Leerzeichen zuviel und das veraltete "qm" und sollte besser `ml/min/1,73
m²` geschrieben werden.
Aus diesem Grunde werden anpassbare Wörterbücher verwendet, die
Aus diesem Grunde werden anpassbare Thesauri verwendet, die
Parameternamen in "kanonische" (CanonicalName) und Lauris-Einheiten in
wirklichkeitsnähere, typographisch korrekte Einheiten übersetzen:
- `zaaReloaded2.Dictionaries.ParameterDictionary`
- `zaaReloaded2.Dictionaries.UnitDictionary`
- `zaaReloaded2.Thesaurus.Parameters`
- `zaaReloaded2.Thesaurus.Units`
Beide Wörterbuch-Typen laden zunächst eingebaute Default-Werte aus der
Beide Thesaurus-Typen laden zunächst eingebaute Default-Werte aus der
Assembly und suchen dann nach Anpassungen auf Benutzerebene.
### Material
Im `ParameterDictionary` wird für jeden Parameter neben dem Kanonischen
Im Thesaurus `Parameters` wird für jeden Parameter neben dem Kanonischen
Namen auch hinterlegt, aus welchem Material er bestimmt wird. Beim
Parsen der Lauris-Ausgabe wird festgelegt, um welches Material es sich
handelt. Auf diese Weise wird ermöglicht, bei der späteren Ausgabe mit
@ -109,7 +109,7 @@ definiert.
### Textdateien zur Konfiguration
Um Anpassungen zu erleichtern und nicht jedes Mal eine neue Version der
Binärdateien zu erfordern, werden für die Wörterbücher einfache
Binärdateien zu erfordern, werden für die Thesauri einfache
Textdateien verwendet.
- Datensätze in Zeilen
@ -120,9 +120,9 @@ Textdateien verwendet.
- Leere Zeilen werden ignoriert
### ParameterDictionary
### Parameters
Das `ParameterDictionary` wird aus einer Textdatei folgenden Formats
Der Thesaurus `Parameters` wird aus einer Textdatei folgenden Formats
generiert:
# LAURIS-NAME "KANONISCHER NAME" MATERIAL "IMMER REFERENZBEREICH"
@ -142,9 +142,9 @@ Die drei Trennstriche `---` in der Zeile "Cystacin C" bedeuten, daß
zaaReloaded2 den Lauris-Namen als kanonischen Namen verwenden soll.
### UnitDictionary
### Units
Das `UnitDictionary` wird aus einer Textdatei folgenden Formats
Der Thesaurus `Units` wird aus einer Textdatei folgenden Formats
generiert:
# LAURIS-EINHEIT "KANONISCHE EINHEIT"
@ -172,7 +172,6 @@ oder nicht-normalen Parametern oder immer mit ausgegeben werden:
- immer
Die Markierung besonderer Parameter erfolgt in der Textdatei, aus der
das `zaaReloaded2.Dictionaries.ParameterDictionary` generiert wird
(s.o.).
das `zaaReloaded2.Thesaurus.Parameters` generiert wird (s.o.).
<!-- vim: set tw=72 sw=2 ts=2 sts=-1 : -->

View File

@ -17,7 +17,7 @@
*/
using System;
using NUnit.Framework;
using zaaReloaded2.Dictionaries;
using zaaReloaded2.Thesaurus;
namespace Tests
{

View File

@ -66,7 +66,7 @@
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="Dictionaries\DictionaryTest.cs" />
<Compile Include="Thesaurus\ThesaurusTest.cs" />
<Compile Include="Formatter\Elements\ItemsTest.cs" />
<Compile Include="Formatter\FormatterTest.cs" />
<Compile Include="Importer\ZaaImporter\LaurisItemTest.cs" />
@ -74,7 +74,7 @@
<Compile Include="Importer\ZaaImporter\ZaaImporterTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="LineParserTest.cs" />
<Compile Include="Dictionaries\TestDictionary.cs" />
<Compile Include="Thesaurus\TestThesaurus.cs" />
<Compile Include="Importer\ZaaImporter\TimePointTest.cs" />
<Compile Include="TestHelpers.cs" />
</ItemGroup>
@ -90,7 +90,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Dictionaries\test_dictionary.txt" />
<EmbeddedResource Include="Thesaurus\test_thesaurus.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="demo-output.txt" />

View File

@ -22,13 +22,14 @@ using System.Linq;
using System.Reflection;
using System.Text;
namespace Tests.Dictionaries
namespace Tests.Thesaurus
{
class TestDictionary : zaaReloaded2.Dictionaries.DictionaryBase
class TestThesaurus : zaaReloaded2.Thesaurus.ThesaurusBase
{
protected override System.IO.Stream GetDefaultStream()
{
return Assembly.GetExecutingAssembly().GetManifestResourceStream("Tests.Dictionaries.test_dictionary.txt");
return Assembly.GetExecutingAssembly()
.GetManifestResourceStream("Tests.Thesaurus.test_thesaurus.txt");
}
protected override string GetUserFileName()

View File

@ -21,15 +21,15 @@ using System.Linq;
using System.Text;
using NUnit.Framework;
namespace Tests.Dictionaries
namespace Tests.Thesaurus
{
[TestFixture]
class DictionaryTest
class ThesaurusTest
{
[Test]
public void DictionaryFromContentStream()
{
TestDictionary td = new TestDictionary();
TestThesaurus td = new TestThesaurus();
Assert.IsTrue(td.Records.ContainsKey("Field 1"));
Assert.AreEqual("Field 2", td.Records["Field 1"][1]);
}

View File

@ -67,8 +67,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// to look up the canonical name, material type, and whether or
/// not to always print the reference interval</param>
public LaurisItem(string laurisString,
Dictionaries.ParameterDictionary parameterDictionary,
Dictionaries.UnitDictionary unitDictionary)
Thesaurus.Parameters parameterDictionary,
Thesaurus.Units unitDictionary)
: this(laurisString)
{
if (parameterDictionary != null)

View File

@ -21,7 +21,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using zaaReloaded2.Dictionaries;
using zaaReloaded2.Thesaurus;
using zaaReloaded2.LabModel;
namespace zaaReloaded2.Importer.ZaaImporter
@ -78,8 +78,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// <param name="unitDictionary">Unit dictionary that contains canonical
/// unit names.</param>
public LaurisParagraph(string paragraph,
Dictionaries.ParameterDictionary parameterDictionary,
Dictionaries.UnitDictionary unitDictionary)
Thesaurus.Parameters parameterDictionary,
Thesaurus.Units unitDictionary)
{
OriginalParagraph = paragraph;
_parameterDictionary = parameterDictionary;
@ -123,8 +123,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
#region Fields
static readonly Regex _expectedFormat = new Regex(@"(?<caption>[^:]+:\s*)?(?<items>[^:]+:\s*[^;]+;)*");
Dictionaries.ParameterDictionary _parameterDictionary;
Dictionaries.UnitDictionary _unitDictionary;
Thesaurus.Parameters _parameterDictionary;
Thesaurus.Units _unitDictionary;
#endregion
}

View File

@ -22,7 +22,7 @@ using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using zaaReloaded2.Dictionaries;
using zaaReloaded2.Thesaurus;
using zaaReloaded2.LabModel;
namespace zaaReloaded2.Importer.ZaaImporter
@ -114,8 +114,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
public LaurisTimePoint(
string laurisText,
ParameterDictionary parameterDictionary,
UnitDictionary unitDictionary)
Parameters parameterDictionary,
Units unitDictionary)
: this()
{
_parameterDictionary = parameterDictionary;
@ -129,8 +129,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
public LaurisTimePoint(
string[] paragraphs,
ParameterDictionary parameterDictionary,
UnitDictionary unitDictionary)
Parameters parameterDictionary,
Units unitDictionary)
: this()
{
_parameterDictionary = parameterDictionary;
@ -222,8 +222,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
static readonly Regex _timeStampRegex = new Regex(
@"^\s*\(?\s*(?<datetime>\d\d\.\d\d\.\d\d\d\d\s+\d\d:\d\d)");
string[] _paragraphs;
ParameterDictionary _parameterDictionary;
UnitDictionary _unitDictionary;
Parameters _parameterDictionary;
Units _unitDictionary;
#endregion
}

View File

@ -22,7 +22,7 @@ using System.Linq;
using System.Text;
using Bovender.Extensions;
using zaaReloaded2.LabModel;
using zaaReloaded2.Dictionaries;
using zaaReloaded2.Thesaurus;
namespace zaaReloaded2.Importer.ZaaImporter
{
@ -107,8 +107,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
public ZaaImporter()
{
_parameters = new ParameterDictionary();
_units = new UnitDictionary();
_parameters = new Parameters();
_units = new Units();
}
#endregion
@ -116,8 +116,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
#region Fields
Laboratory _laboratory;
ParameterDictionary _parameters;
UnitDictionary _units;
Parameters _parameters;
Units _units;
#endregion
}

View File

@ -22,7 +22,7 @@ using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using zaaReloaded2.Dictionaries;
using zaaReloaded2.Thesaurus;
namespace zaaReloaded2.LabModel
{

View File

@ -19,7 +19,7 @@ using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace zaaReloaded2.Dictionaries
namespace zaaReloaded2.Thesaurus
{
/// <summary>
/// Simple parser that separates a line from a text file into

View File

@ -23,14 +23,14 @@ using System.Text;
using System.IO;
using zaaReloaded2.LabModel;
namespace zaaReloaded2.Dictionaries
namespace zaaReloaded2.Thesaurus
{
/// <summary>
/// Dictionary that is used to convert Lauris parameter names to
/// Thesaurus that is used to convert Lauris parameter names to
/// canonical parameter names, and to assign categories and determine
/// which parameters always require the output of reference intervals.
/// </summary>
public class ParameterDictionary : DictionaryBase
public class Parameters : ThesaurusBase
{
#region Public methods
@ -87,7 +87,7 @@ namespace zaaReloaded2.Dictionaries
protected override System.IO.Stream GetDefaultStream()
{
return Assembly.GetExecutingAssembly().GetManifestResourceStream(
"zaaReloaded2.Defaults.parameters.txt");
"zaaReloaded2.Thesaurus.Defaults.parameters.txt");
}
/// <summary>

View File

@ -22,14 +22,14 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace zaaReloaded2.Dictionaries
namespace zaaReloaded2.Thesaurus
{
/// <summary>
/// Base class for the <see cref="ParameterDictionary"/>
/// and the <see cref="UnitDictionary"/>; implements methods
/// Base class for the <see cref="Parameters"/>
/// and the <see cref="Units"/>; implements methods
/// to read configuration files.
/// </summary>
public abstract class DictionaryBase
public abstract class ThesaurusBase
{
#region Public properties
@ -48,7 +48,7 @@ namespace zaaReloaded2.Dictionaries
/// Constructs a new dictionary, loading default data from a built-in
/// resource, and user data from a custom file.
/// </summary>
public DictionaryBase()
public ThesaurusBase()
{
Records = new SortedDictionary<string, string[]>();
LoadDefaultValues();

View File

@ -22,13 +22,13 @@ using System.Text;
using System.IO;
using System.Reflection;
namespace zaaReloaded2.Dictionaries
namespace zaaReloaded2.Thesaurus
{
/// <summary>
/// Dictionary that is used to convert Lauris units to canonical
/// Thesaurus that is used to convert Lauris units to canonical
/// zaaReloaded2 units.
/// </summary>
public class UnitDictionary : DictionaryBase
public class Units : ThesaurusBase
{
#region Public methods
@ -55,7 +55,7 @@ namespace zaaReloaded2.Dictionaries
protected override System.IO.Stream GetDefaultStream()
{
return Assembly.GetExecutingAssembly().GetManifestResourceStream(
"zaaReloaded2.Defaults.units.txt");
"zaaReloaded2.Thesaurus.Defaults.units.txt");
}
/// <summary>

View File

@ -163,7 +163,7 @@
can be found.
-->
<ItemGroup>
<Compile Include="Dictionaries\DictionaryBase.cs" />
<Compile Include="Thesaurus\ThesaurusBase.cs" />
<Compile Include="Formatter\Elements\ElementsList.cs" />
<Compile Include="Formatter\IItemFormatterDictionary.cs" />
<Compile Include="Formatter\ItemFormatter.cs" />
@ -173,9 +173,9 @@
<Compile Include="Formatter\TimePointFormatterDictionary.cs" />
<Compile Include="LabModel\IItemDictionary.cs" />
<Compile Include="LabModel\ItemDictionary.cs" />
<Compile Include="Dictionaries\LineParser.cs" />
<Compile Include="Dictionaries\ParameterDictionary.cs" />
<Compile Include="Dictionaries\UnitDictionary.cs" />
<Compile Include="Thesaurus\LineParser.cs" />
<Compile Include="Thesaurus\Parameters.cs" />
<Compile Include="Thesaurus\Units.cs" />
<Compile Include="Formatter\Elements\ElementBase.cs" />
<Compile Include="Formatter\Elements\Items.cs" />
<Compile Include="Formatter\Formatter.cs" />
@ -226,8 +226,8 @@
<None Include="zaaReloaded2.pfx" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Defaults\parameters.txt" />
<EmbeddedResource Include="Defaults\units.txt" />
<EmbeddedResource Include="Thesaurus\Defaults\parameters.txt" />
<EmbeddedResource Include="Thesaurus\Defaults\units.txt" />
</ItemGroup>
<ItemGroup />
<PropertyGroup>