GithubHelp home page GithubHelp logo

pjoiner / dwc-a_dotnet Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 8.53 MB

A simple Darwin Core Archive Reader for dotnet

License: MIT License

C# 99.38% PowerShell 0.62%
darwincore darwin-core dwc-a biodiversity-informatics dotnet dwc

dwc-a_dotnet's People

Contributors

azure-pipelines[bot] avatar pjoiner avatar sg0218757 avatar

Watchers

 avatar

Forkers

vasnick

dwc-a_dotnet's Issues

Remove index code

After doing some bench marking it was discovered that it is faster to use a LinQ Grouping or ILookup than to use the index code in the FileReader. Remove the code and associated unit tests to simplify the codebase.

StreamReader stops at newlines in quoted fields

The following line will only read up to the first newline

"abc,"def\nghi",lmn"

So only the following fields will be returned

abc
def

We need to allow the tokenizer to cooperate with the StreamReader to ask for more data so it can parse the complete line.

Make Terms extensible

By design the DwC-A standard allows the addition of terms. The Terms class should all extension with custom terms. Suggest using a partial class.

Add GetListOf/TryGetListOf delimited fields

public static IEnumerable<string> GetListOf(this IRow row, string term)
{
    var delimiter = row.FieldMetaData
        .FirstOrDefault(f => f.Term == term)?
        .DelimitedBy;
    if(delimiter == null)
    {
        return new List<string>(){row[term]};
    }
    return row[term].Split(delimiter);
}

public static bool TryGetListOf(this IRow row, string term, out IEnumerable<string> list)
{
    if(row.FieldMetaData.IndexOf(term) == -1)
    {
        list = null;
        return false;
    }
    list = row.GetListOf(term);
    return true;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.