Sha256: cabf58a342f1839af96e0cc7bdeddc326adbc78d556524c08ad7f5707d0266d4

Contents?: true

Size: 1.05 KB

Versions: 18

Compression:

Stored size: 1.05 KB

Contents

// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "encodings/compact_lang_det/win/cld_htmlutils.h"

// Src points to '&'
// Writes entity value to dst. Returns take(src), put(dst) byte counts
void EntityToBuffer(const char* src, int len, char* dst,
                    int* tlen, int* plen) {
  // On Windows we do not have to do anything, browser expands HTML entities
  // for us, so text we're retrieving from it is ready for translation as it is.
  // But:

  // This is a temporary solution to let us continue the development without
  // having a real DOM text scraping in place.  For now the full HTML is fed
  // to CLD for language detection and just ignoring entities is good enough
  // for testing.  Later entities will be expanded by browser itself.

  // Skip entity in the source.
  *tlen = 1;
  do {
    ++src;
    ++*tlen;
  } while (*src && *src != ';');
  // Report a bogus entity (space).
  *dst = ' ';
  *plen = 1;
}

Version data entries

18 entries across 18 versions & 4 rubygems

Version Path
cld-0.13.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
language_detection-0.1.1 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.12.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
language_detection-0.1.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.11.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.10.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.8.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-fixed-0.7.1 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.7.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
language_detection-0.0.2 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
language_detection-0.0.1 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.6.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.5.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_windows.cc
krukid-cld-0.4.0 encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.4.0 encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.3.0 encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.2.0 encodings/compact_lang_det/win/cld_htmlutils_windows.cc
cld-0.1.0 encodings/compact_lang_det/win/cld_htmlutils_windows.cc