จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: UnicodeTranscode:: คุณสมบัติ
#include <string_ops.h>
ตัวตั้งค่าแอตทริบิวต์เพิ่มเติมสำหรับ UnicodeTranscode
สรุป
งานสาธารณะ |
---|
Errors (StringPiece x) | นโยบายการจัดการข้อผิดพลาดเมื่อพบการจัดรูปแบบที่ไม่ถูกต้องในอินพุต |
ReplaceControlCharacters (bool x) | ว่าจะแทนที่อักขระควบคุม C0 (00-1F) ด้วย replacement_char หรือไม่ |
ReplacementChar (int64 x) | จุดโค้ดอักขระทดแทนที่จะใช้แทนการจัดรูปแบบที่ไม่ถูกต้องในอินพุตเมื่อ errors='replace' |
คุณลักษณะสาธารณะ
ข้อผิดพลาด_
StringPiece tensorflow::ops::UnicodeTranscode::Attrs::errors_ = "replace"
แทนที่_ควบคุม_อักขระ_
bool tensorflow::ops::UnicodeTranscode::Attrs::replace_control_characters_ = false
เปลี่ยน_ถ่าน_
int64 tensorflow::ops::UnicodeTranscode::Attrs::replacement_char_ = 65533
งานสาธารณะ
ข้อผิดพลาด
TF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::Errors(
StringPiece x
)
นโยบายการจัดการข้อผิดพลาดเมื่อพบการจัดรูปแบบที่ไม่ถูกต้องในอินพุต
ค่า 'เข้มงวด' จะทำให้การดำเนินการสร้างข้อผิดพลาด InvalidArgument ในการจัดรูปแบบอินพุตที่ไม่ถูกต้อง ค่า 'replace' (ค่าเริ่มต้น) จะทำให้การดำเนินการแทนที่การจัดรูปแบบที่ไม่ถูกต้องในอินพุตด้วย codepoint replacement_char
ค่า 'ละเว้น' จะทำให้การดำเนินการข้ามการจัดรูปแบบที่ไม่ถูกต้องในอินพุต และไม่มีอักขระเอาต์พุตที่สอดคล้องกัน
ค่าเริ่มต้นคือ "แทนที่"
แทนที่อักขระควบคุม
TF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::ReplaceControlCharacters(
bool x
)
ว่าจะแทนที่อักขระควบคุม C0 (00-1F) ด้วย replacement_char
หรือไม่
ค่าเริ่มต้นเป็นเท็จ
ค่าเริ่มต้นเป็นเท็จ
ถ่านทดแทน
TF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::ReplacementChar(
int64 x
)
จุดโค้ดอักขระทดแทนที่จะใช้แทนการจัดรูปแบบที่ไม่ถูกต้องในอินพุตเมื่อ errors='replace'
สามารถใช้จุดโค้ดยูนิโค้ด ที่ ถูกต้องได้ ค่าเริ่มต้นคืออักขระแทนที่ Unicode เริ่มต้นคือ 0xFFFD หรือ U+65533)
โปรดทราบว่าสำหรับ UTF-8 การส่งอักขระแทนที่ที่แสดงเป็น 1 ไบต์ เช่น ' ' จะคงการจัดแนวสตริงไว้ที่ต้นทาง เนื่องจากไบต์ที่ไม่ถูกต้องจะถูกแทนที่ด้วยการแทนที่ 1 ไบต์ สำหรับ UTF-16-BE และ UTF-16-LE อักขระแทนที่ 1 หรือ 2 ไบต์ใดๆ จะรักษาการจัดตำแหน่งของไบต์กับแหล่งที่มา
ค่าเริ่มต้นคือ 65533
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-28 UTC
[null,null,["อัปเดตล่าสุด 2025-07-28 UTC"],[],[],null,["# tensorflow::ops::UnicodeTranscode::Attrs Struct Reference\n\ntensorflow::ops::UnicodeTranscode::Attrs\n========================================\n\n`#include \u003cstring_ops.h\u003e`\n\nOptional attribute setters for [UnicodeTranscode](/versions/r1.15/api_docs/cc/class/tensorflow/ops/unicode-transcode#classtensorflow_1_1ops_1_1_unicode_transcode).\n\nSummary\n-------\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------------------------------------------|---------------|\n| [errors_](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1abcd1383b9be66c3a3bb38f35eb35d7c8)` = \"replace\"` | `StringPiece` |\n| [replace_control_characters_](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1a98f8a37849498e2da67eac2ad35642a2)` = false` | `bool` |\n| [replacement_char_](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1afe5534f218249f3369c91e047af3775b)` = 65533` | `int64` |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Errors](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1ab1e6a46bf9d2cc08d188a8f65ce5af5f)`(StringPiece x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs) Error handling policy when there is invalid formatting found in the input. |\n| [ReplaceControlCharacters](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1a14ef90d95676aea36bd25eb2589cf726)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs) Whether to replace the C0 control characters (00-1F) with the `replacement_char`. |\n| [ReplacementChar](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1aff6611b37bc42f8b41c1341a2588c7eb)`(int64 x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/unicode-transcode/attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs) The replacement character codepoint to be used in place of any invalid formatting in the input when `errors='replace'`. |\n\nPublic attributes\n-----------------\n\n### errors_\n\n```scdoc\nStringPiece tensorflow::ops::UnicodeTranscode::Attrs::errors_ = \"replace\"\n``` \n\n### replace_control_characters_\n\n```scdoc\nbool tensorflow::ops::UnicodeTranscode::Attrs::replace_control_characters_ = false\n``` \n\n### replacement_char_\n\n```scdoc\nint64 tensorflow::ops::UnicodeTranscode::Attrs::replacement_char_ = 65533\n``` \n\nPublic functions\n----------------\n\n### Errors\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::Errors(\n StringPiece x\n)\n``` \nError handling policy when there is invalid formatting found in the input.\n\nThe value of 'strict' will cause the operation to produce a InvalidArgument error on any invalid input formatting. A value of 'replace' (the default) will cause the operation to replace any invalid formatting in the input with the `replacement_char` codepoint. A value of 'ignore' will cause the operation to skip any invalid formatting in the input and produce no corresponding output character.\n\nDefaults to \"replace\" \n\n### ReplaceControlCharacters\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::ReplaceControlCharacters(\n bool x\n)\n``` \nWhether to replace the C0 control characters (00-1F) with the `replacement_char`.\n\nDefault is false.\n\nDefaults to false \n\n### ReplacementChar\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::ReplacementChar(\n int64 x\n)\n``` \nThe replacement character codepoint to be used in place of any invalid formatting in the input when `errors='replace'`.\n\n[Any](/versions/r1.15/api_docs/cc/class/tensorflow/ops/any#classtensorflow_1_1ops_1_1_any) valid unicode codepoint may be used. The default value is the default unicode replacement character is 0xFFFD or U+65533.)\n\nNote that for UTF-8, passing a replacement character expressible in 1 byte, such as ' ', will preserve string alignment to the source since invalid bytes will be replaced with a 1-byte replacement. For UTF-16-BE and UTF-16-LE, any 1 or 2 byte replacement character will preserve byte alignment to the source.\n\nDefaults to 65533"]]