<commit_before>// Copyright 2014 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package orchestrator

import (
	"allmark.io/modules/common/route"
	"allmark.io/modules/web/view/viewmodel"
)

type UpdateOrchestrator struct {
	*Orchestrator

	viewModelOrchestrator *ViewModelOrchestrator
}

func (orchestrator *UpdateOrchestrator) StartWatching(route route.Route) {
	orchestrator.repository.StartWatching(route)
}

func (orchestrator *UpdateOrchestrator) StopWatching(route route.Route) {
	orchestrator.repository.StopWatching(route)
}

func (orchestrator *UpdateOrchestrator) GetUpdatedModel(itemRoute route.Route) (viewModel viewmodel.Model, found bool) {
	model, found := orchestrator.viewModelOrchestrator.GetViewModel(itemRoute)
	if !found {
		return viewmodel.Model{}, false
	}

	return model, true
}<commit_msg>Fixed the snippet update issue<commit_after>// Copyright 2014 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package orchestrator

import (
	"allmark.io/modules/common/route"
	"allmark.io/modules/web/view/viewmodel"
)

type UpdateOrchestrator struct {
	*Orchestrator

	viewModelOrchestrator *ViewModelOrchestrator
}

func (orchestrator *UpdateOrchestrator) StartWatching(route route.Route) {
	orchestrator.repository.StartWatching(route)
}

func (orchestrator *UpdateOrchestrator) StopWatching(route route.Route) {
	orchestrator.repository.StopWatching(route)
}

func (orchestrator *UpdateOrchestrator) GetUpdatedModel(itemRoute route.Route) (viewModel viewmodel.Model, found bool) {
	model, found := orchestrator.viewModelOrchestrator.GetFullViewModel(itemRoute)
	if !found {
		return viewmodel.Model{}, false
	}

	return model, true
}
{'fraction_non_alphanumeric': 0.09315068493150686, 'fraction_numerical': 0.004383561643835616, 'mean_word_length': 5.7380073800738005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2645057', 'n_tokens_mistral': 579, 'n_tokens_neox': 580, 'n_words': 142}