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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: udpipe
Type: Package
Title: Tokenization, Parts of Speech Tagging, Lemmatization and Dependency
Parsing with the 'UDPipe' 'NLP' Toolkit
Version: 0.8.12
Version: 0.8.13
Maintainer: Jan Wijffels <jwijffels@bnosac.be>
Authors@R: c(
person('Jan', 'Wijffels', role = c('aut', 'cre', 'cph'), email = 'jwijffels@bnosac.be'),
Expand Down Expand Up @@ -43,4 +43,4 @@ Suggests:
topicmodels,
lattice,
parallel
RoxygenNote: 7.1.2
RoxygenNote: 7.3.2
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## CHANGES IN udpipe VERSION 0.8.13

- fix load of misaligned address and UBSan messages reported by CRAN

## CHANGES IN udpipe VERSION 0.8.12

- avoid warning: overlapping comparisons always evaluate to true in parse_int
Expand Down
8 changes: 4 additions & 4 deletions man/cooccurrence.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/document_term_frequencies.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions man/document_term_matrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions man/udpipe_download_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions src/udpipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3391,26 +3391,26 @@ T* unaligned_upper_bound(T* first, size_t size, T val);
template<class T, class P>
inline T unaligned_load(const P* ptr) {
T value;
memcpy(&value, ptr, sizeof(T));
memcpy(&value, (const void*)ptr, sizeof(T));
return value;
}

template<class T, class P>
inline T unaligned_load_inc(const P*& ptr) {
T value;
memcpy(&value, ptr, sizeof(T));
memcpy(&value, (const void*)ptr, sizeof(T));
((const char*&)ptr) += sizeof(T);
return value;
}

template<class T, class P>
inline void unaligned_store(P* ptr, T value) {
memcpy(ptr, &value, sizeof(T));
memcpy((void*)ptr, &value, sizeof(T));
}

template<class T, class P>
inline void unaligned_store_inc(P*& ptr, T value) {
memcpy(ptr, &value, sizeof(T));
memcpy((void*)ptr, &value, sizeof(T));
((char*&)ptr) += sizeof(T);
}

Expand Down Expand Up @@ -3518,7 +3518,7 @@ struct persistent_unordered_map::fnv_hash {
uint32_t size = data.next_4B();
mask = size - 2;
hash.resize(size);
memcpy(hash.data(), data.next<uint32_t>(size), size * sizeof(uint32_t));
memcpy(hash.data(), (const void*)data.next<uint32_t>(size), size * sizeof(uint32_t));

size = data.next_4B();
this->data.resize(size);
Expand Down Expand Up @@ -12762,8 +12762,8 @@ void gru_tokenizer_network::matrix<R, C>::clear() {

template <int R, int C>
void gru_tokenizer_network::matrix<R, C>::load(binary_decoder& data) {
for (int i = 0; i < R; i++) memcpy(w[i], data.next<float>(C), sizeof(float) * C);
memcpy(b, data.next<float>(R), sizeof(float) * R);
for (int i = 0; i < R; i++) memcpy(w[i], (const void*)data.next<float>(C), sizeof(float) * C);
memcpy(b, (const void*)data.next<float>(R), sizeof(float) * R);
}

template <int D>
Expand Down Expand Up @@ -12858,7 +12858,7 @@ gru_tokenizer_network_implementation<D>* gru_tokenizer_network_implementation<D>

for (unsigned chars = data.next_4B(); chars; chars--) {
auto& embedding = network->embeddings[data.next_4B()];
copy_n(data.next<float>(D), D, embedding.e.w[0]);
memcpy(embedding.e.w[0], (const void*)data.next<float>(D), sizeof(float) * D);
}
fill_n(network->empty_embedding.e.w[0], D, 0.f);

Expand Down Expand Up @@ -15071,7 +15071,7 @@ void embedding::load(binary_decoder& data) {

// Load weights
weights.resize(dimension * (dictionary.size() + (unknown_index >= 0)));
memcpy(weights.data(), data.next<float>(weights.size()), sizeof(float) * weights.size());
memcpy(weights.data(), (const void*)data.next<float>(weights.size()), sizeof(float) * weights.size());
}

} // namespace parsito
Expand Down Expand Up @@ -15243,7 +15243,7 @@ void neural_network::load_matrix(binary_decoder& data, vector<vector<float>>& m)
m.resize(rows);
for (auto&& row : m) {
row.resize(columns);
memcpy(row.data(), data.next<float>(columns), sizeof(float) * columns);
memcpy(row.data(), (const void*)data.next<float>(columns), sizeof(float) * columns);
}
}

Expand Down
Loading