<commit_before>import { SpriteData } from './spriteData.interface'; 

/**
 * Sprite class, represents a graphical asset usable by the game.
 */
export class Sprite {

  /** Options */
  
  _spriteData: SpriteData;
  _precise: boolean;

  /** Properties */
  
  _width: number = 0;
  _height: number = 0;

  /**
   * 
   * @param {SpriteData} spriteData Sprite data that defines the appearance of the sprite.
   * @param {boolean} [precise=false] Use precise collision checking.
   */
  constructor(spriteData:SpriteData, precise:boolean = false) {
    this._spriteData = Sprite.normalizeSpriteData(spriteData);
    this._precise = precise;

    /** Assign default origin */
    if (!this._spriteData.origin) { this._spriteData.origin = { x:0, y:0 }; }    

    /** Calculate the width and height of the sprite */
    this._spriteData.points.forEach(pointRow => {
      this._width = pointRow.length > this._width ? pointRow.length : this._width;
      this._height++;
    });
  }

  /**
   * 
   * @param {SpriteData} spriteData Sprite data to normalize
   */
  static normalizeSpriteData(spriteData:SpriteData):SpriteData {
    let fixedPoints:Array<Array<number>> = [];
<commit_msg>Updated sprite normalize method msdoc<commit_after>import { SpriteData } from './spriteData.interface'; 

/**
 * Sprite class, represents a graphical asset usable by the game.
 */
export class Sprite {

  /** Options */
  
  _spriteData: SpriteData;
  _precise: boolean;

  /** Properties */
  
  _width: number = 0;
  _height: number = 0;

  /**
   * 
   * @param {SpriteData} spriteData Sprite data that defines the appearance of the sprite.
   * @param {boolean} [precise=false] Use precise collision checking.
   */
  constructor(spriteData:SpriteData, precise:boolean = false) {
    this._spriteData = Sprite.normalizeSpriteData(spriteData);
    this._precise = precise;

    /** Assign default origin */
    if (!this._spriteData.origin) { this._spriteData.origin = { x:0, y:0 }; }    

    /** Calculate the width and height of the sprite */
    this._spriteData.points.forEach(pointRow => {
      this._width = pointRow.length > this._width ? pointRow.length : this._width;
      this._height++;
    });
  }

  /**
   * Normalizes shorthand sprite data.
   * @param {SpriteData} spriteData Sprite data to normalize
   */
  static normalizeSpriteData(spriteData:SpriteData):SpriteData {
    let fixedPoints:Array<Array<number>> = [];

{'fraction_non_alphanumeric': 0.12412371134020618, 'fraction_numerical': 0.0032989690721649486, 'mean_word_length': 3.2786596119929454, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '2730645', 'n_tokens_mistral': 770, 'n_tokens_neox': 740, 'n_words': 186}