Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing doc for segmenter, and turn on the missing_docs warning #2366

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

aethanyc
Copy link
Contributor

I follow the wording of try_new in FFI.

/// Construct an [`ICU4XGraphemeClusterBreakSegmenter`].

@codecov-commenter
Copy link

Codecov Report

Merging #2366 (a2f7bc9) into main (084fca3) will decrease coverage by 3.51%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2366      +/-   ##
==========================================
- Coverage   78.21%   74.69%   -3.52%     
==========================================
  Files         409      416       +7     
  Lines       33328    34964    +1636     
==========================================
+ Hits        26066    26116      +50     
- Misses       7262     8848    +1586     
Impacted Files Coverage Δ
experimental/segmenter/src/grapheme.rs 49.12% <ø> (ø)
experimental/segmenter/src/lib.rs 100.00% <ø> (ø)
experimental/segmenter/src/line.rs 76.93% <ø> (ø)
experimental/segmenter/src/sentence.rs 49.12% <ø> (ø)
experimental/segmenter/src/word.rs 62.01% <ø> (ø)
provider/blob/src/blob_data_provider.rs 60.60% <0.00%> (-3.92%) ⬇️
provider/blob/src/static_data_provider.rs 90.90% <0.00%> (-2.85%) ⬇️
utils/yoke/derive/src/lib.rs 94.52% <0.00%> (ø)
components/datetime/src/input.rs 71.02% <0.00%> (ø)
ffi/diplomat/src/properties_maps.rs 0.00% <0.00%> (ø)
... and 8 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -152,6 +153,8 @@ mod line;
mod sentence;
mod word;

// icu_datagen uses provider, but we don't want to expose this implementation detail to the users.
#[doc(hidden)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the provider module is already documented, and we generally keep it public in other crates, since it is effectively part of our public API. I think you can document or suppress docs on particular structs/fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will revert this hunk, and add more docs.

@@ -113,6 +113,7 @@ pub struct LineBreakSegmenter {
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: can you move the examples in the top-level lib.rs into each of the individual structs? Then you don't need to say "Please see the module-level documentation". This would be better, and the top-level documentation can link down to each individual segmenter struct for details.

There should still be at least one top-level example, probably for either word break or line break.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice suggestion! Will do.

Comment on lines +109 to 114
#[allow(missing_docs)]
#[cfg_attr(feature = "serde", serde(borrow))]
pub dim: ZeroVec<'data, i16>,
#[allow(missing_docs)]
#[cfg_attr(feature = "serde", serde(borrow))]
pub data: ZeroVec<'data, f32>,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: I don't know lstm well enough to document these two fields. @sffc or @makotokato Could you help on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #[allow(missing_docs)] is okay for now.

@robertbastian robertbastian removed their request for review August 12, 2022 09:44
@aethanyc aethanyc removed the request for review from Manishearth August 12, 2022 17:33
@aethanyc
Copy link
Contributor Author

@makotokato @sffc Can I have your review for this PR?

@aethanyc aethanyc added the waiting-on-reviewer PRs waiting for action from the reviewer for >7 days label Aug 18, 2022
@sffc
Copy link
Member

sffc commented Aug 18, 2022

@makotokato @sffc Can I have your review for this PR?

Yes; in the future just hit the re-request review button so it shows up in my queue.

@sffc sffc self-requested a review August 18, 2022 19:23
@aethanyc
Copy link
Contributor Author

Yes; in the future just hit the re-request review button so it shows up in my queue.

Ah, thank you for the tip and the review!

@aethanyc aethanyc removed the waiting-on-reviewer PRs waiting for action from the reviewer for >7 days label Aug 18, 2022
@aethanyc aethanyc merged commit c2be4f2 into unicode-org:main Aug 18, 2022
@aethanyc aethanyc deleted the segmenter-doc branch August 18, 2022 23:10
@aethanyc aethanyc mentioned this pull request Aug 18, 2022
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants