about summary refs log tree commit diff stats
path: root/data/maps/the_revitalized/rooms/Hidden Room.txtpb
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-09-09 11:51:42 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-09-09 11:51:42 -0400
commit6dc4fae2ee9b7b9145a8938e95080dba448cf44a (patch)
tree53d77f928f47b31d47964ce7abfebb7a8b99c80c /data/maps/the_revitalized/rooms/Hidden Room.txtpb
parentc4bd95a0b310df43cdebe1593fac0d5f0de64da2 (diff)
parenta825f800a04334ac8a4338c5fe88d7bbce49c022 (diff)
downloadlingo2-archipelago-6dc4fae2ee9b7b9145a8938e95080dba448cf44a.tar.gz
lingo2-archipelago-6dc4fae2ee9b7b9145a8938e95080dba448cf44a.tar.bz2
lingo2-archipelago-6dc4fae2ee9b7b9145a8938e95080dba448cf44a.zip
Merge branch 'main' of fourisland.com:/srv/git/lingo2-archipelago
Diffstat (limited to 'data/maps/the_revitalized/rooms/Hidden Room.txtpb')
0 files changed, 0 insertions, 0 deletions
*/ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include <string>
#include <map>
#include <list>
#include <vector>
#include "histogram.h"

#ifndef KGRAMSTATS_H
#define KGRAMSTATS_H

struct word {
  std::string canon;
  histogram<std::string> forms;
  histogram<std::string> terms;
  
  word(std::string canon) : canon(canon) {}
  
  bool operator<(const word& other) const
  {
    return canon < other.canon;
  }
};

extern word blank_word;

enum class suffixtype {
  none,
  terminating,
  comma
};

enum class parentype {
  paren,
  square_bracket,
  asterisk,
  quote
};

enum class doublestatus {
  opening,
  closing,
  both
};

struct delimiter {
  parentype type;
  doublestatus status;
  
  delimiter(parentype type, doublestatus status) : type(type), status(status) {}
  
  bool operator<(const delimiter& other) const
  {
    return std::tie(type, status) < std::tie(other.type, other.status);
  }
};

struct token {
  const word& w;
  std::map<delimiter, int> delimiters;
  suffixtype suffix;
  std::string raw;
    
  token(const word& w) : w(w), suffix(suffixtype::none) {}
  
  bool operator<(const token& other) const
  {
    return std::tie(w, delimiters, suffix) < std::tie(other.w, other.delimiters, other.suffix);
  }
};

enum class querytype {
  literal,
  sentence
};

struct query {
  querytype type;
  token tok;
  
  query(token tok) : tok(tok), type(querytype::literal) {}
  
  query(querytype type) : tok(blank_word), type(type) {}
  
  bool operator<(const query& other) const
  {
    if (type == other.type)
    {
      return tok < other.tok;
    } else {
      return type < other.type;
    }
  }
};

typedef std::list<query> kgram;

class kgramstats
{
public:
	kgramstats(std::string corpus, int maxK);
	std::string randomSentence(int maxL);
	
private:
	struct token_data
	{
		int all;
		int titlecase;
		int uppercase;
    token tok;
    
    token_data(token tok) : tok(tok), all(0), titlecase(0), uppercase(0) {}
	};
  
	int maxK;
	std::map<kgram, std::map<int, token_data> > stats;
  
  // Words
  std::map<std::string, word> words;
  word hashtags {"#hashtag"};
  word emoticons {"👌"};
};

void printKgram(kgram k);

#endif