<commit_before>#ifndef _CANVAS_TEXTALIGN_H_
#define _CANVAS_TEXTALIGN_H_

namespace canvas {
  enum TextAlign {
    START = 1,
    END,
    LEFT,
    CENTER,
    RIGHT
  };
};

#endif
<commit_msg>change TextAlign from enum to clas<commit_after>#ifndef _CANVAS_TEXTALIGN_H_
#define _CANVAS_TEXTALIGN_H_

namespace canvas {
  class TextAlign {
  public:
    enum TextAlignType {
      START = 1,
      END,
      LEFT,
      CENTER,
      RIGHT
    };
    
    TextAlign(TextAlignType _type = LEFT) : type(_type) { }
    TextAlign(const std::string & _type) { setType(_type.c_str()); }
    TextAlign(const char * _type) { setType(_type); }
    TextAlign & operator=(const std::string & _type) { setType(_type.c_str()); return *this; }
    TextAlign & operator=(const char * _type) { setType(_type); return *this; }

    TextAlignType getType() const { return type; }
    
  private:
    void setType(const char * _type) {
      if (strcmp(_type, "start") == 0) type = START;
      else if (strcmp(_type, "end") == 0) type = END;
      else if (strcmp(_type, "left") == 0) type = LEFT;
      else if (strcmp(_type, "center") == 0) type = CENTER;
      else if (strcmp(_type, "right") == 0) type = RIGHT;
      else {
	assert(0);
	type = START;
      }
    };

    TextAlignType type;
  };
};

#endif

{'fraction_non_alphanumeric': 0.1318427139552814, 'fraction_numerical': 0.006168080185042405, 'mean_word_length': 2.921450151057402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '714649', 'n_tokens_mistral': 468, 'n_tokens_neox': 457, 'n_words': 114}