Skip to content

Commit

Permalink
updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Sep 22, 2024
1 parent 49ca945 commit 646aef5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/annotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ impl AnnotationStore {
/// .with_id("myresource")
/// .with_text("Hello world")
/// )?
/// .add(
/// AnnotationDataSet::new(Config::default())
/// .with_id("mydataset"),
/// .with_dataset(
/// AnnotationDataSetBuilder::new()
/// .with_id("mydataset")
/// )?;
///
/// //do some other stuff in the middle (otherwise you could have just as well used with_annotation())
Expand Down
11 changes: 5 additions & 6 deletions src/annotationstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use crate::types::*;
/// .with_id("myresource")
/// .with_text("Hello world")
/// )?
/// .add(AnnotationDataSet::new(Config::default()).with_id("mydataset"))?
/// .with_dataset(AnnotationDataSetBuilder::new().with_id("mydataset"))?
/// .with_annotation(
/// AnnotationBuilder::new()
/// .with_id("A1")
Expand All @@ -92,11 +92,10 @@ use crate::types::*;
/// .with_id("myresource")
/// .with_text("Hello world")
/// )?
/// .add(
/// AnnotationDataSet::new(Config::default())
/// .with_id("mydataset")
/// .add(DataKey::new("part-of-speech"))?
/// .with_data_with_id("part-of-speech", "noun", "D1")?,
/// .with_dataset(AnnotationDataSetBuilder::new()
/// .with_id("mydataset")
/// .with_key("part-of-speech")
/// .with_key_value_id("part-of-speech", "noun", "D1")
/// )?
/// .with_annotation(
/// AnnotationBuilder::new()
Expand Down
9 changes: 3 additions & 6 deletions src/api/annotationdataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,9 @@ impl<'store> ResultItem<'store, AnnotationDataSet> {
/// # fn main() -> Result<(),StamError> {
/// # let store = AnnotationStore::default()
/// # .with_id("example")
/// # .add(TextResource::from_string(
/// # "myresource",
/// # "Hello world",
/// # Config::default(),
/// # ))?
/// # .add(AnnotationDataSet::new(Config::default()).with_id("mydataset"))?
/// # .with_resource(TextResourceBuilder::new().with_id("myresource").with_text("Hello world")
/// # )?
/// # .with_dataset(AnnotationDataSetBuilder::new().with_id("mydataset"))?
/// # .with_annotation(
/// # AnnotationBuilder::new()
/// # .with_id("A1")
Expand Down
12 changes: 6 additions & 6 deletions src/api/annotationstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ impl AnnotationStore {
/// # fn main() -> Result<(),StamError> {
/// # let store = AnnotationStore::default()
/// # .with_id("example")
/// # .add(TextResource::from_string(
/// # "myresource",
/// # "Hello world",
/// # Config::default(),
/// # ))?
/// # .add(AnnotationDataSet::new(Config::default()).with_id("mydataset"))?
/// # .with_resource(
/// # TextResourceBuilder::new().with_id("myresource").with_text("Hello world")
/// # )?
/// # .with_dataset(
/// # AnnotationDataSetBuilder::new().with_id("mydataset")
/// # )?
/// # .with_annotation(
/// # AnnotationBuilder::new()
/// # .with_id("A1")
Expand Down

0 comments on commit 646aef5

Please sign in to comment.