#ifndef JSC_H #define JSC_H /** * (C) 2018 Jordan Sherer - All Rights Reserved **/ #include #include #include #include #include #include typedef QMap CompressionMap; // Map(Word, I) where I is the word index sorted by frequency typedef QList CompressionList; // List(Word) where list is sorted typedef QPair CompressionTable; // Tuple(Map, List) typedef QPair, int> CodewordPair; // Tuple(Codeword, N) where N = number of characters typedef QVector Codeword; class JSC { public: static CompressionTable loadCompressionTable(); static CompressionTable loadCompressionTable(QTextStream &stream); static QList compress(CompressionTable table, QString text); static QString decompress(CompressionTable table, Codeword const& bits); static const int size = 233638; static char const* map[]; static char const* list[]; }; #endif // JSC_H