1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
//! This is an graph-based linguistic corpus query system which implements the ANNIS Query Language (AQL).
//! The main entry point to the API is the [CorpusStorage](struct.CorpusStorage.html) struct which allows to manage and query a database of corpora.

// workaround for doc.rs bug that uses nightly compiler and complains that the global allocator is not stabilized yet
#![cfg_attr(docs_rs_workaround, feature(global_allocator,allocator_api))]
// `error_chain!` can recurse deeply
#![recursion_limit = "1024"]

extern crate graphannis_malloc_size_of as malloc_size_of;
#[macro_use]
extern crate graphannis_malloc_size_of_derive as malloc_size_of_derive;
#[macro_use]
extern crate log;

#[macro_use]
extern crate error_chain;

extern crate linked_hash_map;
extern crate multimap;
extern crate rand;
extern crate regex;
extern crate regex_syntax;
extern crate rustc_hash;
extern crate tempdir;

extern crate bincode;
extern crate serde;

extern crate csv;

extern crate strum;
#[macro_use]
extern crate strum_macros;

#[macro_use]
extern crate serde_derive;

#[macro_use]
extern crate lazy_static;

extern crate fs2;
extern crate itertools;
#[macro_use]
extern crate lalrpop_util;
extern crate num;
extern crate rayon;
extern crate sys_info;

#[cfg(feature = "c-api")]
extern crate libc;
#[cfg(feature = "c-api")]
extern crate simplelog;
#[cfg(feature = "c-api")]
pub mod capi;

// Make sure the allocator is always the one from the system, otherwise we can't make sure our memory estimations work
use std::alloc::System;
#[global_allocator]
static GLOBAL: System = System;

mod annis;

pub use annis::db::corpusstorage::CorpusStorage;

/// Types that are used by the `CorpusStorage` API.
pub mod corpusstorage {
    pub use annis::db::corpusstorage::{
        CorpusInfo, FrequencyDefEntry, GraphStorageInfo, LoadStatus, QueryLanguage, ResultOrder,
    };
    pub use annis::types::{CountExtra, FrequencyTable, QueryAttributeDescription};
}

pub use annis::db::update;

pub use annis::db::Graph;

/// Types that are used by the `Graph` API.
pub mod graph {
    pub use annis::db::graphstorage::GraphStatistic;
    pub use annis::db::graphstorage::{EdgeContainer, GraphStorage, WriteableGraphStorage};
    pub use annis::db::AnnotationStorage;
    pub use annis::db::Match;
    pub use annis::types::{AnnoKey, Annotation, Component, ComponentType, Edge, NodeID};

}

/// Functions dealing with the legacy [relANNIS import file format](http://korpling.github.io/ANNIS/doc/dev-annisimportformat.html).
pub mod relannis {
    pub use annis::db::relannis::load;
}

/// Contains the graphANNIS-specific error types generated by the [error chain crate](https://crates.io/crates/error-chain).
pub mod errors {
    pub use annis::errors::*;
}

/// Utility functions.
pub mod util {
    pub use annis::util::extract_node_path;
    pub use annis::util::get_queries_from_folder;
    pub use annis::util::SearchDef;
}