Thrill  0.1
examples::word_count Namespace Reference

Classes

struct  HashWordHasher
 

Typedefs

using HashWord = std::pair< size_t, std::string >
 
using HashWordCount = std::pair< HashWord, size_t >
 
using WordCountPair = std::pair< std::string, size_t >
 

Functions

template<typename InputStack >
auto HashWordCountExample (const DIA< std::string, InputStack > &input)
 
template<typename RandomGenerator >
std::string RandomTextWriterGenerate (size_t num_words, RandomGenerator &rng)
 
template<typename InputStack >
auto WordCount (const DIA< std::string, InputStack > &input)
 

Variables

static constexpr size_t s_num_random_text_writer_words
 
static const char * s_random_text_writer_words []
 

Typedef Documentation

◆ HashWord

using HashWord = std::pair<size_t, std::string>

Definition at line 60 of file word_count.hpp.

◆ HashWordCount

using HashWordCount = std::pair<HashWord, size_t>

Definition at line 61 of file word_count.hpp.

◆ WordCountPair

using WordCountPair = std::pair<std::string, size_t>

Definition at line 30 of file word_count.hpp.

Function Documentation

◆ HashWordCountExample()

auto examples::word_count::HashWordCountExample ( const DIA< std::string, InputStack > &  input)

The second WordCount user program: reads a DIA containing std::string words, creates hash values from the words prior to reducing by hash and word. Returns a DIA containing WordCountPairs.

Definition at line 74 of file word_count.hpp.

References StringView::size(), tlx::split_view(), and StringView::to_string().

Referenced by RunHashWordCount(), and RunHashWordCountGenerated().

◆ RandomTextWriterGenerate()

std::string examples::word_count::RandomTextWriterGenerate ( size_t  num_words,
RandomGenerator &  rng 
)

◆ WordCount()

auto examples::word_count::WordCount ( const DIA< std::string, InputStack > &  input)

The most basic WordCount user program: reads a DIA containing std::string words, and returns a DIA containing WordCountPairs.

Definition at line 35 of file word_count.hpp.

References DIA< ValueType_, Stack_ >::ReduceByKey(), StringView::size(), tlx::split_view(), and StringView::to_string().

Variable Documentation

◆ s_num_random_text_writer_words

constexpr size_t s_num_random_text_writer_words
static
Initial value:
=
static const char * s_random_text_writer_words[]

Definition at line 225 of file random_text_writer.hpp.

Referenced by RandomTextWriterGenerate().

◆ s_random_text_writer_words

const char* s_random_text_writer_words[]
static

Definition at line 28 of file random_text_writer.hpp.

Referenced by RandomTextWriterGenerate().