message: try to detect body text language

Try to detect the language of the e-mail body and make it searchable.
This commit is contained in:
Dirk-Jan C. Binnema
2023-05-11 23:22:29 +03:00
parent ad64093183
commit 7f2eeb1010
4 changed files with 29 additions and 9 deletions

View File

@ -52,6 +52,7 @@ struct Field {
File, /**< Filename */
Flags, /**< Message flags */
From, /**< Message sender */
Language, /**< Body language */
Maildir, /**< Maildir path */
MailingList, /**< Mailing list */
MessageId, /**< Message Id */
@ -252,7 +253,6 @@ static constexpr std::array<Field, Field::id_size()>
Field::Flag::IncludeInSexp |
Field::Flag::IndexableTerm,
},
{
Field::Id::Changed,
Field::Type::TimeT,
@ -316,6 +316,17 @@ static constexpr std::array<Field, Field::id_size()>
Field::Flag::IncludeInSexp |
Field::Flag::IndexableTerm,
},
{
Field::Id::Language,
Field::Type::String,
"language", "lang",
"ISO 639-1 language code for body",
"lang:nl",
'a',
Field::Flag::BooleanTerm |
Field::Flag::Value |
Field::Flag::IncludeInSexp
},
{
Field::Id::Maildir,
Field::Type::String,