<commit_before>package core

import (
  "fmt"
)

type Location struct {
  className string
  sourceName string
  lineNumber int
  lineOffset int
}

func NewLocation(sourceName string, lineNumber int, lineOffset int) Location {
  return Location { "core.Locationn", sourceName, lineNumber, lineOffset }
}

func (self Location) GetSourceName() string {
  return self.sourceName
}

func (self Location) GetLineNumber() int {
  return self.lineNumber
}

func (self Location) GetLineOffset() int {
  return self.lineOffset
}

func (self Location) String() string {
  return fmt.Sprintf("[%s:%d,%d]", self.sourceName, self.lineNumber, self.lineOffset)
}

func (self Location) MarshalJSON() ([]byte, error) {
  s := fmt.Sprintf("%q", self.String())
  return []byte(s), nil
}<commit_msg>Display line number/offset of location as 1-origin<commit_after>package core

import (
  "fmt"
)

type Location struct {
  className string
  sourceName string
  lineNumber int
  lineOffset int
}

func NewLocation(sourceName string, lineNumber int, lineOffset int) Location {
  return Location { "core.Locationn", sourceName, lineNumber, lineOffset }
}

func (self Location) GetSourceName() string {
  return self.sourceName
}

func (self Location) GetLineNumber() int {
  return self.lineNumber
}

func (self Location) GetLineOffset() int {
  return self.lineOffset
}

func (self Location) String() string {
  // display as "1 origin"
  return fmt.Sprintf("[%s:%d,%d]", self.sourceName, self.lineNumber+1, self.lineOffset+1)
}

func (self Location) MarshalJSON() ([]byte, error) {
  s := fmt.Sprintf("%q", self.String())
  return []byte(s), nil
}
{'fraction_non_alphanumeric': 0.12300123001230012, 'fraction_numerical': 0.0024600246002460025, 'mean_word_length': 4.7695035460992905, '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': '6564121', 'n_tokens_mistral': 507, 'n_tokens_neox': 504, 'n_words': 154}