Skip to content

A .NET library to convert "Beta Code"-encoded ancient greek strings to unicode.

License

Notifications You must be signed in to change notification settings

grammophone/Grammophone.BetaImport

Repository files navigation

Grammophone.BetaImport

This is a simple .NET library to convert ASCII strings containing "beta code"-encoded ancient Greek texts to Unicode. Both composing and precombined diacritics are supported.

These two converters are derived from the abstract BetaConverter, named ComposingDiacriticsBetaConverter and PrecombinedDiacriticsBetaConverter respectively. The inherited method Convert can be used directly, but they can also be combined with BetaReader, a descendant of the .NET standard TextReader for text streaming scenarios. As a simple example, the following WPF code fragment uses a file dialog to open a beta code file and place its contents in a text box:

var dialog = new Microsoft.Win32.OpenFileDialog();

dialog.DefaultExt = ".txt";
dialog.Filter = "Text documents|*.txt";

if (dialog.ShowDialog(this) == true)
{
  using (Stream inputStream = dialog.OpenFile())
  {
    using (var betaReader = new BetaReader(inputStream, new PrecombinedDiacriticsBetaConverter()))
    //using (var betaReader = new BetaReader(inputStream, new ComposingDiacriticsBetaConverter()))
    {
      fileTextBox.Text = dialog.FileName;
      contentTextBox.ScrollToHome();
      contentTextBox.Text = betaReader.ReadToEnd();
    }
  }
}

The above code fragment is part of a simple demo WPF application used to view contents of beta code files. It can be found here.

The library has no dependencies.

About

A .NET library to convert "Beta Code"-encoded ancient greek strings to unicode.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages