Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1108)

Unified Diff: third_party/cld/bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.h

Issue 122007: [chromium-reviews] Add Compact Language Detection (CLD) library to Chrome. This works in Windows... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/cld/bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.h
===================================================================
--- third_party/cld/bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.h (revision 0)
+++ third_party/cld/bar/toolbar/cld/i18n/encodings/compact_lang_det/win/cld_unicodetext.h (revision 0)
@@ -0,0 +1,34 @@
+// 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.
+
+#ifndef BAR_TOOLBAR_CLD_I18N_ENCODINGS_COMPACT_LANG_DET_WIN_CLD_UNICODETEXT_H_
+#define BAR_TOOLBAR_CLD_I18N_ENCODINGS_COMPACT_LANG_DET_WIN_CLD_UNICODETEXT_H_
+
+#include <windows.h>
+
+#include "third_party/cld/bar/toolbar/cld/i18n/languages/public/languages.h"
+
+
+// Detects a language of the UTF-16 encoded zero-terminated text.
+// [in] text - UTF-16 encoded text to detect a language of.
+// [in] is_plain_text - true if plain text, false otherwise (e.g. HTML).
+// [out] is_reliable - true, if returned language was detected reliably.
+// See compact_lang_det.h for details.
+// [out] num_languages - set to the number of languages detected on the page.
+// Language counts only if it's detected in more than 20% of the text.
+// [out, optional] error_code - set to 0 in case of success, Windows
+// GetLastError() code otherwise. Pass NULL, if not interested in errors.
+// See bar/toolbar/cld/i18n/encodings/compact_lang_det/compact_lang_det.h,
+// CompactLangDet::DetectLanguage() description for other input parameters
+// description.
+// Returns: Language enum.
+// Returns NUM_LANGUAGES in case of any error.
+// See googleclient/bar/toolbar/cld/i18n/languages/internal/languages.cc
+// for details.
+Language DetectLanguageOfUnicodeText(const WCHAR* text, bool is_plain_text,
+ bool* is_reliable, int* num_languages,
+ DWORD* error_code);
+
+
+#endif // BAR_TOOLBAR_CLD_I18N_ENCODINGS_COMPACT_LANG_DET_WIN_CLD_UNICODETEXT_H_
Property changes on: third_party\cld\bar\toolbar\cld\i18n\encodings\compact_lang_det\win\cld_unicodetext.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698