Conllu 1.1.2

dotnet add package Conllu --version 1.1.2
                    
NuGet\Install-Package Conllu -Version 1.1.2
                    
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.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Conllu" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Conllu" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Conllu --version 1.1.2
                    
#r "nuget: Conllu, 1.1.2"
                    
#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.
#:package Conllu@1.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Conllu&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Conllu&version=1.1.2
                    
Install as a Cake Tool

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 net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.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.2 287 11/19/2024
1.1.1 5,755 11/1/2021
1.1.0 592 1/31/2021
1.0.2 436 1/17/2021
1.0.1 456 1/10/2021
1.0.0 443 1/9/2021