Skip to content
プロジェクト

概要

Nevodはパターンベースのテキスト検索を行うための言語およびテクノロジーです。

開発ツール

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Nevod

Nuget

This repo contains the sources of the Nevod library, as well as the code to build the Nevod NuGet package and the Negrep command-line utility for all supported platforms.

What is Nevod?

Nevod is a language and technology for pattern-based text search. It is specially aimed to rapidly reveal entities and their relationships in texts written in the natural language.

Nevod Playground

The Nevod Web site is also an open-source project, hosted on GitLab: https://gitlab.com/nezaboodka/nevod.website

The Target Platform

The Nevod technology is based on the .NET Standard 2.0. It runs on Linux, Windows and macOS.

How Can I Use Nevod in My Project?

You can use Nevod in the following ways:

  • Download source code and link it into your source tree.
  • Add reference to the Nevod NuGet package.
  • Download and use the command-line negrep utility, which is pre-compiled for Windows, Linux and macOS.

Example of Usage in C# Code

Below is the simple example that demonstrates usage of the Nevod library in C# code.

static void SimpleExample()
{
    var patternPackage = PatternPackage.FromText("#Google = {'Google', ~'Google Drive'};");
    var searchEngine = new TextSearchEngine(patternPackage);
    var searchResult = searchEngine.Search("Google but not Google Drive");
    foreach (var tag in searchResult.GetTags())
        Console.WriteLine(tag.GetText());
}

In the above example the pattern package is created from text with pattern definition. Then the search engine is created and used to search for the pattern in a given text string.

You may find this example in the Source/Example/Program.cs file.

There is also advanced example, which demonstrates advanced techniques like usage of package cache, package builder with options, stream-based text source, search options, as well as search result handling callback.

static void AdvancedExample(string packageName, string textFile)
{
    // Create package cache. It should be a global static object in real life
    var packageCache = new PackageCache();

    // Create pattern package
    var packageBuilder = new PackageBuilder(
        new PackageBuilderOptions() { SyntaxInformationBinding = true },
        packageCache);
    var patternPackage = packageBuilder.BuildPackageFromFile(packageName);

    // Create parsed text source from text file stream
    var textReader = new StreamReader(textFile);
    var textSource = new StreamTextSource(textReader, shouldCloseReader: true, 64_000);

    // Create search engine with specific candidate limits
    var searchEngine = new TextSearchEngine(
        patternPackage,
        new SearchOptions() { CandidateLimit = 100_000, PatternCandidateLimit = 10_000 });

    // Search and output pattern name for each match
    searchEngine.Search(textSource,
        (SearchEngine searchEngine, MatchedTag tag) =>
        {
            Console.WriteLine(tag.PatternFullName);
        });
}

License

Nevod is licensed under Apache 2.0 license, which includes the patent license.

関連プロジェクトを探す

読み込み中…