<commit_before>#include "nearest_road_pos_finder.hpp"

#include "../geometry/distance.hpp"

#include "../indexer/feature.hpp"

namespace routing
{
void NearestRoadPosFinder::AddInformationSource(const FeatureType & ft)
{
  if (ft.GetFeatureType() != feature::GEOM_LINE || m_vehicleModel->GetSpeed(ft) == 0.0)
    return;

  Candidate res;

  ft.ParseGeometry(FeatureType::BEST_GEOMETRY);

  size_t const count = ft.GetPointsCount();
  ASSERT_GREATER(count, 1, ());
  for (size_t i = 1; i < count; ++i)
  {
    /// @todo Probably, we need to get exact projection distance in meters.
    m2::ProjectionToSection<m2::PointD> segProj;
    segProj.SetBounds(ft.GetPoint(i - 1), ft.GetPoint(i));

    m2::PointD const pt = segProj(m_point);
    double const d = m_point.SquareLength(pt);
    if (d < res.m_dist)
    {
      res.m_dist = d;
      res.m_fid = ft.GetID().m_offset;
      res.m_segId = i - 1;
      res.m_point = pt;
      res.m_isOneway = m_vehicleModel->IsOneWay(ft);
      if (m_mwmId == MwmSet::INVALID_MWM_ID)
        m_mwmId = ft.GetID().m_mwm;
    }
  }

  if (res.m_fid != INVALID_FID)
    m_candidates.push_back(res);
}

void NearestRoadPosFinder::MakeResult(vector<RoadPos> & res, const size_t maxCount)
{
  if (m_mwmId == MwmSet::INVALID_MWM_ID)
    return;<commit_msg>Restored ASSERT.<commit_after>#include "nearest_road_pos_finder.hpp"

#include "../geometry/distance.hpp"

#include "../indexer/feature.hpp"

#include "../base/assert.hpp"

namespace routing
{
void NearestRoadPosFinder::AddInformationSource(const FeatureType & ft)
{
  if (ft.GetFeatureType() != feature::GEOM_LINE || m_vehicleModel->GetSpeed(ft) == 0.0)
    return;

  Candidate res;

  ft.ParseGeometry(FeatureType::BEST_GEOMETRY);

  size_t const count = ft.GetPointsCount();
  ASSERT_GREATER(count, 1, ());
  for (size_t i = 1; i < count; ++i)
  {
    /// @todo Probably, we need to get exact projection distance in meters.
    m2::ProjectionToSection<m2::PointD> segProj;
    segProj.SetBounds(ft.GetPoint(i - 1), ft.GetPoint(i));

    m2::PointD const pt = segProj(m_point);
    double const d = m_point.SquareLength(pt);
    if (d < res.m_dist)
    {
      res.m_dist = d;
      res.m_fid = ft.GetID().m_offset;
      res.m_segId = i - 1;
      res.m_point = pt;
      res.m_isOneway = m_vehicleModel->IsOneWay(ft);
      if (m_mwmId == MwmSet::INVALID_MWM_ID)
        m_mwmId = ft.GetID().m_mwm;
      ASSERT_EQUAL(ft.GetID().m_mwm, m_mwmId, ());
    }
  }

  if (res.m_fid != INVALID_FID)
    m_candidates.push_back(res);
}

void NearestRoadPosFinder::MakeResult(vector<RoadPos> & res, const size_t maxCount)
{
  if (m_mwmId == MwmSet::INVALID_MWM_ID)
    return;
{'fraction_non_alphanumeric': 0.14441519368183528, 'fraction_numerical': 0.006769462203836028, 'mean_word_length': 3.602076124567474, 'pattern_counts': {'":': 0, '<': 11, '<?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': '7570919', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1030, 'n_words': 186}