From 766209e9ba7c4f442258becb78a14e93de69be1a Mon Sep 17 00:00:00 2001 From: Adam Radziszewski <eliasz@nietbuk.(none)> Date: Wed, 7 Sep 2011 22:25:07 +0200 Subject: [PATCH] add mask filled with 1's to use for POS masking --- libcorpus2/CMakeLists.txt | 2 +- libcorpus2/tag.h | 2 ++ libpwrutils/bitset.h | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libcorpus2/CMakeLists.txt b/libcorpus2/CMakeLists.txt index 9d07000..e705fff 100644 --- a/libcorpus2/CMakeLists.txt +++ b/libcorpus2/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(corpus2) set(corpus2_ver_major "1") set(corpus2_ver_minor "0") -set(corpus2_ver_patch "10") +set(corpus2_ver_patch "11") if(NOT LIBCORPUS2_SRC_DATA_DIR) diff --git a/libcorpus2/tag.h b/libcorpus2/tag.h index 2713071..9041ca4 100644 --- a/libcorpus2/tag.h +++ b/libcorpus2/tag.h @@ -34,6 +34,8 @@ typedef boost::int8_t idx_t; typedef PwrNlp::bitset<64> mask_t; BOOST_STRONG_TYPEDEF(boost::uint32_t, tagset_idx_t); +const mask_t filled_mask(PwrNlp::filled_bitset<64>()); + /** * This is an extended version of a POS tag, which also includes a number * of attributes which may have values set. diff --git a/libpwrutils/bitset.h b/libpwrutils/bitset.h index a28a757..358b71e 100644 --- a/libpwrutils/bitset.h +++ b/libpwrutils/bitset.h @@ -37,6 +37,13 @@ static const size_t ulong_bits = sizeof(unsigned long) * CHAR_BIT; typedef bitset<ulong_bits> word_bitset; +template<size_t S> +std::bitset<S> filled_bitset() +{ + std::bitset<S> b = std::bitset<S>(); + b.flip(); + return b; +} /** * Count set bits in a integral type. -- GitLab