Struct conllx::Writer [] [src]

pub struct Writer<W> { /* fields omitted */ }

A writer for CoNLL-X sentences.

This writer will write sentences to the embedded writer in CoNLL-X tabular format.

Methods

impl<W: Write> Writer<W>
[src]

[src]

Construct a new writer from an object that implements the io::Write trait.

[src]

Borrow the embedded writer. Getting the underlying writer is often useful when the writer writes to a memory object.

Examples

use conllx::{Sentence, Token, WriteSentence, Writer};
use std::str;

let output = Vec::new();
let mut writer = Writer::new(output);
let sent = vec![
  Token::new("hello"),
  Token::new("world"),
];

writer.write_sentence(&sent).unwrap();

println!("Output:\n{}", str::from_utf8(writer.get_ref()).unwrap());

Trait Implementations

impl<W: Write> WriteSentence for Writer<W>
[src]

[src]

Write a Sentence into this object. Read more