Skip to content

Commit 646aef5

Browse files
committed
updated examples
1 parent 49ca945 commit 646aef5

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

src/annotation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ impl AnnotationStore {
477477
/// .with_id("myresource")
478478
/// .with_text("Hello world")
479479
/// )?
480-
/// .add(
481-
/// AnnotationDataSet::new(Config::default())
482-
/// .with_id("mydataset"),
480+
/// .with_dataset(
481+
/// AnnotationDataSetBuilder::new()
482+
/// .with_id("mydataset")
483483
/// )?;
484484
///
485485
/// //do some other stuff in the middle (otherwise you could have just as well used with_annotation())

src/annotationstore.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use crate::types::*;
6565
/// .with_id("myresource")
6666
/// .with_text("Hello world")
6767
/// )?
68-
/// .add(AnnotationDataSet::new(Config::default()).with_id("mydataset"))?
68+
/// .with_dataset(AnnotationDataSetBuilder::new().with_id("mydataset"))?
6969
/// .with_annotation(
7070
/// AnnotationBuilder::new()
7171
/// .with_id("A1")
@@ -92,11 +92,10 @@ use crate::types::*;
9292
/// .with_id("myresource")
9393
/// .with_text("Hello world")
9494
/// )?
95-
/// .add(
96-
/// AnnotationDataSet::new(Config::default())
97-
/// .with_id("mydataset")
98-
/// .add(DataKey::new("part-of-speech"))?
99-
/// .with_data_with_id("part-of-speech", "noun", "D1")?,
95+
/// .with_dataset(AnnotationDataSetBuilder::new()
96+
/// .with_id("mydataset")
97+
/// .with_key("part-of-speech")
98+
/// .with_key_value_id("part-of-speech", "noun", "D1")
10099
/// )?
101100
/// .with_annotation(
102101
/// AnnotationBuilder::new()

src/api/annotationdataset.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,9 @@ impl<'store> ResultItem<'store, AnnotationDataSet> {
9595
/// # fn main() -> Result<(),StamError> {
9696
/// # let store = AnnotationStore::default()
9797
/// # .with_id("example")
98-
/// # .add(TextResource::from_string(
99-
/// # "myresource",
100-
/// # "Hello world",
101-
/// # Config::default(),
102-
/// # ))?
103-
/// # .add(AnnotationDataSet::new(Config::default()).with_id("mydataset"))?
98+
/// # .with_resource(TextResourceBuilder::new().with_id("myresource").with_text("Hello world")
99+
/// # )?
100+
/// # .with_dataset(AnnotationDataSetBuilder::new().with_id("mydataset"))?
104101
/// # .with_annotation(
105102
/// # AnnotationBuilder::new()
106103
/// # .with_id("A1")

src/api/annotationstore.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,12 @@ impl AnnotationStore {
269269
/// # fn main() -> Result<(),StamError> {
270270
/// # let store = AnnotationStore::default()
271271
/// # .with_id("example")
272-
/// # .add(TextResource::from_string(
273-
/// # "myresource",
274-
/// # "Hello world",
275-
/// # Config::default(),
276-
/// # ))?
277-
/// # .add(AnnotationDataSet::new(Config::default()).with_id("mydataset"))?
272+
/// # .with_resource(
273+
/// # TextResourceBuilder::new().with_id("myresource").with_text("Hello world")
274+
/// # )?
275+
/// # .with_dataset(
276+
/// # AnnotationDataSetBuilder::new().with_id("mydataset")
277+
/// # )?
278278
/// # .with_annotation(
279279
/// # AnnotationBuilder::new()
280280
/// # .with_id("A1")

0 commit comments

Comments
 (0)