Skip to content

Commit

Permalink
Rename ConlluParser and update csproj for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurDevNL committed Jan 9, 2021
1 parent 5f1c066 commit 72d3448
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
8 changes: 5 additions & 3 deletions Conllu/Conllu/Conllu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackageId>Conllu</PackageId>
<Authors>Arthur Hemmer</Authors>
<Description>A lightweight C# CoNNL-U parser.</Description>
<Description>A lightweight C# CoNLL-U parser.</Description>
<Copyright>Arthur Hemmer 2021</Copyright>
<PackageLicenseUrl>https://github.com/ArthurDevNL/CoNLL-Parser/blob/main/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/ArthurDevNL/CoNLL-Parser</RepositoryUrl>
<PackageLicenseUrl>https://github.com/ArthurDevNL/CoNLL-U/blob/main/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/ArthurDevNL/CoNLL-U</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>CONLLU;NLP;PARSER</PackageTags>
<Title>CoNLL-U</Title>
<PackageVersion>1.0.0</PackageVersion>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion Conllu/Conllu/Conllu.cs → Conllu/Conllu/ConlluParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Conllu
{
public static class Conllu
public static class ConlluParser
{
public static IEnumerable<Sentence> ParseFile(string filePath)
=> Parse(File.ReadLines(filePath));
Expand Down
7 changes: 4 additions & 3 deletions Conllu/ConlluTests/ConlluTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Conllu;
using Conllu.Enums;
using NUnit.Framework;

Expand All @@ -22,7 +23,7 @@ public void TestParse()
using var reader = new StreamReader(stream);
var text = reader.ReadToEnd();

var result = Conllu.Conllu.ParseText(text).ToList();
var result = ConlluParser.ParseText(text).ToList();
Assert.AreEqual(1, result.Count);

var sentence = result.First();
Expand Down Expand Up @@ -57,7 +58,7 @@ public void TestSentenceMetadata()
// ReSharper disable once AssignNullToNotNullAttribute
using var reader = new StreamReader(stream);
var text = reader.ReadToEnd();
var result = Conllu.Conllu.ParseText(text).ToList();
var result = Conllu.ConlluParser.ParseText(text).ToList();
Assert.AreEqual(1, result.Count);

var s = result.First();
Expand All @@ -73,7 +74,7 @@ public void TestParseLargeFile()
// ReSharper disable once AssignNullToNotNullAttribute
using var reader = new StreamReader(stream);
var text = reader.ReadToEnd();
var result = Conllu.Conllu.ParseText(text).ToList();
var result = Conllu.ConlluParser.ParseText(text).ToList();
Assert.AreEqual(2002, result.Count);
Assert.IsTrue(result.All(x => !x.IsEmpty()));
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CoNLL-U is available as a NuGet package. Once installed, you can start as follow

```
var filePath = ...
var sentences = Conllu.ParseFile(filePath);
var sentences = ConlluParser.ParseFile(filePath);
```

Each `Sentence` contains a list of `Token` which contain all the information as specified in the CoNLL-U format. Below is a short overview of some of the fields that are available in the `Token` class:
Expand Down

0 comments on commit 72d3448

Please sign in to comment.