Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion harper-core/src/dict_word_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ pub struct DictWordMetadata {
pub common: bool,
#[serde(default = "default_none")]
pub derived_from: Option<WordId>,
/// Generated by a chunker. Declares whether the word is a member of a nominal phrase.
/// Generated by a chunker. Declares whether the word is a member of a nominal phrase. Using
/// this should be preferred over the similarly named `Pattern`.
///
/// For more details, see [the announcement blog post](https://elijahpotter.dev/articles/training_a_chunker_with_burn).
pub np_member: Option<bool>,
/// Generated by a POS tagger. Declares what it inferred the word's part of speech to be.
pub pos_tag: Option<UPOS>,
Expand Down
3 changes: 3 additions & 0 deletions harper-core/src/patterns/nominal_phrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ use crate::Token;

use super::Pattern;

/// A pattern that uses primitive syntax-tree heuristics to locate nominal phrases.
/// Given that it does not take context into account, it is not recommended for new code.
/// Please prefer [`DictWordMetadata::np_member`](crate::DictWordMetadata::np_member).
#[derive(Default)]
pub struct NominalPhrase;

Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ newest-dict-changes *numCommits:
});
});

# Print the input string or file with nominal phrases highlighted.
# Print the input string or file with nominal phrases highlighted. These are generated using Harper's chunker.
getnps text:
cargo run --bin harper-cli -- nominal-phrases "{{text}}"

Expand Down
Loading