<commit_before>package main

import (
	"github.com/gbl08ma/disturbancesmlx/dataobjects"
	"github.com/gbl08ma/disturbancesmlx/scraper"
)

var annStore AnnouncementStore

// AnnouncementStore implements dataobjects.AnnouncementStore
type AnnouncementStore struct {
	scrapers map[string]scraper.AnnouncementScraper
}

// AddScraper registers all sources provided by this scraper
func (as *AnnouncementStore) AddScraper(scraper scraper.AnnouncementScraper) {
	for _, source := range scraper.Sources() {
		as.scrapers[source] = scraper
	}
}

// AllAnnouncements gets all announcements from all sources, unsorted
func (as *AnnouncementStore) AllAnnouncements() []*dataobjects.Announcement {
	ann := []*dataobjects.Announcement{}
	for source, scraper := range as.scrapers {
		ann = append(ann, scraper.Announcements(source)...)
	}<commit_msg>Fix assignment to nil map<commit_after>package main

import (
	"github.com/gbl08ma/disturbancesmlx/dataobjects"
	"github.com/gbl08ma/disturbancesmlx/scraper"
)

var annStore AnnouncementStore

// AnnouncementStore implements dataobjects.AnnouncementStore
type AnnouncementStore struct {
	scrapers map[string]scraper.AnnouncementScraper
}

// AddScraper registers all sources provided by this scraper
func (as *AnnouncementStore) AddScraper(s scraper.AnnouncementScraper) {
	if as.scrapers == nil {
		as.scrapers = make(map[string]scraper.AnnouncementScraper)
	}
	for _, source := range s.Sources() {
		as.scrapers[source] = s
	}
}

// AllAnnouncements gets all announcements from all sources, unsorted
func (as *AnnouncementStore) AllAnnouncements() []*dataobjects.Announcement {
	ann := []*dataobjects.Announcement{}
	for source, scraper := range as.scrapers {
		ann = append(ann, scraper.Announcements(source)...)
	}
{'fraction_non_alphanumeric': 0.1026811180832858, 'fraction_numerical': 0.004563605248146035, 'mean_word_length': 5.7203065134099615, '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': '5583341', 'n_tokens_mistral': 605, 'n_tokens_neox': 590, 'n_words': 125}