Conllu 1.1.1

dotnet add package Conllu --version 1.1.1
NuGet\Install-Package Conllu -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Conllu" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Conllu --version 1.1.1
#r "nuget: Conllu, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Conllu as a Cake Addin
#addin nuget:?package=Conllu&version=1.1.1

// Install Conllu as a Cake Tool
#tool nuget:?package=Conllu&version=1.1.1

CoNLL-U Parser in .NET Core

.NET Core Nuget

This repository contains a lightweight, well-tested CoNLL-U parser written in C# .NET Core and parses according to the CoNLL-U format as specified by Universal Dependencies.

Quick Start

CoNLL-U is available as a NuGet package. Once installed, you can start as follows:

var 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:

public class Token
{
    // CoNLL-U Properties
    int Id;
    string Form;
    string Lemma;
    string Upos;
    string Xpos;
    Dictionary<string, string> Feats;
    int? Head;
    string DepRel;
    Dictionary<TokenIdentifier, string> Deps;
    string Misc;
    
    // Other properties
    TokenIdentifier Identifier;
    string RawLine;
    bool IsMultiwordToken;
    bool IsEmptyNode;
}

In addition, there is a TokenIdentifier class which wraps the different possibilities for word ID such as multi word tokens or empty nodes.

You can also serialize a Sentence back into a CoNLL-U file format. You can simply do this as follows:

Sentence s;
var text =  ConlluParser.Serialize(s);
System.IO.File.WriteAllText(@"C:\path\to\file.conllu", text);

To-do

Below is a list of items that are still planned for the package. Feel free to open an issue or pull request for any other additional functionalities and/or bugfixes.

  • Support empty nodes
  • Add serialization support to generate .conllu files
  • Add tree parsing helper functions

License

Copyright (c) 2021 Arthur Hemmer

Distributed under the MIT License (MIT).

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Conllu:

Package Downloads
Chiron.Nlp

Chiron NLP-related components

Fusi.UDPipe

Minimalist API surface for https://github.com/ufal/udpipe.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 5,104 11/1/2021
1.1.0 477 1/31/2021
1.0.2 318 1/17/2021
1.0.1 340 1/10/2021
1.0.0 326 1/9/2021