分析器标签用于标识某个解答是_如何_解出的。
这些标签随后可以用来:
标签是一个字符串,格式为:<category>:<thing>。
我们支持四种不同的类别,层级从高到低:
| Category | Description | Specificity | Examples |
|---|---|---|---|
paradigm |
一种编程范式 | 层级很高,不特定于某个轨道 |
imperative、functional
|
technique |
所使用的一种技巧 | 层级较高,大多数不特定于某个轨道 |
recursion、immutability
|
construct |
一种语言构造 | 很多不特定于某个轨道 |
bitwise-and、for-loop
|
uses |
特定于某门语言的用法,比如类型或方法 | 层级较低,特定于某个轨道 |
DateTime.add_seconds、IEnumerable
|
一些示例标签:
paradigm:functionaltechnique:recursionconstruct:bitwise-anduses:DateTime.add_seconds虽然各个轨道可以按自己的方式给解答打标签,但我们建议尽可能使用下面这份常用标签列表。 使用一套通用的标签,能让我们实现一些巧妙的功能,比如跨轨道关联解答。
| Tag | Description |
|---|---|
paradigm:array |
使用数组编程。 |
paradigm:declarative |
使用声明式编程。 |
paradigm:functional |
使用函数式编程。 |
paradigm:generic |
使用泛型编程。 |
paradigm:imperative |
使用命令式编程。 |
paradigm:logic |
使用逻辑编程。 |
paradigm:meta |
使用元编程。 |
paradigm:object-oriented |
使用面向对象编程。 |
paradigm:procedural |
使用过程式编程。 |
paradigm:reflective |
使用反射式编程。 |
paradigm:stack-oriented |
使用栈导向编程。 |
| Tag | Description |
|---|---|
technique:bit-manipulation |
操作二进制位,通常通过位运算符(例如 AND、XOR 或左移) |
technique:bit-shifting |
对数字中的二进制位进行移位 |
technique:boolean-logic |
执行布尔逻辑(AND、OR、NOT) |
technique:composition |
使用组合 |
technique:concurrency |
并发地运行代码 |
technique:enumeration |
对值进行枚举 |
technique:error-handling |
处理错误 |
technique:exceptions |
捕获或抛出异常 |
technique:function-composition |
使用函数组合 |
technique:generator |
使用生成器 |
technique:higher-order-functions |
使用高阶函数 |
technique:immutability |
使用不可变性 |
technique:immutable-collection |
使用内容不可变的集合 |
technique:inheritance |
使用继承 |
technique:laziness |
惰性地生成值,只在需要时才生成 |
technique:locks |
使用锁来独占访问资源 |
technique:looping |
使用循环 |
technique:math |
使用数学运算 |
technique:memory-management |
管理内存 |
technique:ordering |
确定数据的顺序 |
technique:parallelism |
并行地运行代码 |
technique:parser |
解析数据 |
technique:pointers |
使用指针 |
technique:randomness |
使用随机性 |
technique:recursion |
使用递归 |
technique:regular-expression |
使用正则表达式 |
technique:short-circuiting |
使用短路求值来避免不必要的计算 |
technique:sorted-collection |
使用元素始终有序的集合 |
technique:sorting |
对数据排序 |
technique:tail-call-optimization |
使用尾调用优化来实现高效的递归 |
technique:type-conversion |
把值从一种类型转换为另一种类型 |
technique:unsafe |
使用不安全代码(例如指针运算) |
| Tag | Description |
|---|---|
construct:abstract-class |
定义抽象类 |
construct:abstract-method |
定义抽象方法 |
construct:add-assignment |
把加法与赋值结合 |
construct:add |
使用加法 |
construct:array |
使用或声明数组 |
construct:assignment |
把值赋值或绑定到变量/名称 |
construct:async-await |
使用async/await
|
construct:attribute |
用元数据标注成员 |
construct:auto-implemented-property |
定义自动实现的属性 |
construct:big-integer |
使用大整数 |
construct:binary-number |
用二进制表示法定义数字 |
construct:bit-array |
使用或声明位数组 |
construct:bitwise-and-assignment |
把按位 AND 与赋值结合 |
construct:bitwise-and |
执行按位 AND |
construct:bitwise-left-shift-assignment |
把按位左移与赋值结合 |
construct:bitwise-left-shift |
执行按位左移 |
construct:bitwise-not |
执行按位 NOT |
construct:bitwise-or-assignment |
把按位 OR 与赋值结合 |
construct:bitwise-or |
执行按位 OR |
construct:bitwise-right-shift-assignment |
把按位右移与赋值结合 |
construct:bitwise-right-shift |
执行按位右移 |
construct:bitwise-xor-assignment |
把按位 XOR 与赋值结合 |
construct:bitwise-xor |
执行按位 XOR |
construct:block |
定义一个包含一系列语句的代码块 |
construct:boolean |
定义或使用布尔值 |
construct:boxing |
使用装箱 |
construct:break |
跳出循环 |
construct:byte |
使用无符号 8 位整数 |
construct:catch |
捕获异常 |
construct:char |
使用字符 |
construct:checked-arithmetic |
使用受检算术(可防止溢出) |
construct:class |
定义类 |
construct:collection-initializer |
通过初始化器设置集合的值 |
construct:command |
定义命令 |
construct:comment |
定义注释 |
construct:comparison-chaining |
串联多个比较调用 |
construct:comparison |
比较两个值的相对顺序 |
construct:complex-number |
使用复数 |
construct:computed-string |
定义计算得到的字符串 |
construct:concatenation |
拼接值 |
construct:conditional-access |
有条件地访问方法 |
construct:conditional-operator |
使用三元条件运算符 |
construct:conditional |
有条件地执行代码 |
construct:constant |
定义常量(不可变)值 |
construct:constructor |
定义构造函数 |
construct:continue |
继续循环的下一次迭代 |
construct:conversion-operator |
定义转换运算符 |
construct:copy |
复制值 |
construct:coroutine |
定义或使用协程 |
construct:custom-attribute |
定义自定义特性 |
construct:date-time |
使用同时表示日期和时间的值 |
construct:date |
使用表示日期(不含时间)的值 |
construct:decimal |
使用 128 位浮点数 |
construct:decrement |
对值进行自减 |
construct:default-interface-implementation |
在接口中定义默认实现 |
construct:default |
定义默认值(例如形参的默认值) |
construct:destructuring |
把值解构为各个部分 |
construct:dictionary-comprehension |
通过推导式创建字典 |
construct:dictionary |
使用/定义字典/映射 |
construct:discard |
使用特殊的弃元值 |
construct:divide-assignment |
把除法与赋值结合 |
construct:divide |
使用除法 |
construct:do-while-loop |
使用do-while循环 |
construct:double |
使用 64 位浮点数 |
construct:else |
定义 else 分支 |
construct:enum |
定义或使用枚举(值的枚举) |
construct:equality |
比较两个值是否相等 |
construct:error |
定义或使用错误 |
construct:event |
定义或使用事件 |
construct:exception |
定义或使用异常 |
construct:explicit-conversion |
显式地把一种类型转换为另一种类型 |
construct:explicit-import |
只导入选定的功能 |
construct:exponentiation |
计算一个值的幂 |
construct:expression-bodied-member |
定义表达式主体成员 |
construct:extension-method |
定义扩展方法 |
construct:field-access |
访问字段 |
construct:field |
定义字段 |
construct:finally |
使用 finally 确保某个代码块总会执行 |
construct:flags-enum |
定义或使用标志枚举 |
construct:float |
使用 32 位浮点数 |
construct:floating-point-number |
使用浮点数 |
construct:for-loop |
使用for循环 |
construct:foreach |
使用foreach循环 |
construct:function-overloading |
使用函数重载 |
construct:function |
定义函数 |
construct:generator |
定义生成器函数或方法 |
construct:generic-function |
定义用一个或多个类型参数化的函数 |
construct:generic-method |
定义用一个或多个类型参数化的方法 |
construct:generic-type |
定义用一个或多个类型参数化的类型 |
construct:getter |
定义 getter |
construct:global-function |
定义全局可用的函数 |
construct:global-variable |
定义全局可用的变量 |
construct:header |
定义头文件 |
construct:hexadecimal-number |
用十六进制表示法定义数字 |
construct:if |
使用if语句 |
construct:implicit-conversion |
隐式地把一种类型转换为另一种类型 |
construct:implicit-loop |
隐式地遍历一个值集合 |
construct:implicit-return |
隐式地返回值 |
construct:import |
导入在别处实现的功能(例如来自命名空间/模块) |
construct:increment |
对值进行自增 |
construct:index-operator |
定义用于索引对象的运算符 |
construct:indexer |
定义或使用索引器 |
construct:indexing |
通过下标访问值 |
construct:inequality |
比较两个值是否不相等 |
construct:infix-operator |
定义中缀运算符 |
construct:initialization |
在创建之后初始化对象 |
construct:initializer-list |
初始化对象字段的值 |
construct:initializer |
初始化对象 |
construct:instance |
创建或使用某个类型的实例 |
construct:instantiation |
创建某个类型的实例 |
construct:int |
使用有符号 32 位整数 |
construct:integral-number |
使用整数值(整数) |
construct:interface |
定义接口 |
construct:invocation |
调用方法/函数 |
construct:iterator |
定义可迭代的函数或方法 |
construct:jagged-array |
使用交错数组(数组的数组) |
construct:lambda |
定义 lambda(即“匿名函数”) |
construct:linked-list |
使用链表 |
construct:linq |
使用 LINQ |
construct:list-comprehension |
通过推导式构建列表 |
construct:list |
使用列表 |
construct:local-function |
定义局部函数 |
construct:local-variable |
定义局部变量 |
construct:lock |
使用锁 |
construct:logical-and |
执行逻辑 AND |
construct:logical-not |
执行逻辑 NOT |
construct:logical-or |
执行逻辑 OR |
construct:long |
使用有符号 64 位整数 |
construct:loop |
定义循环 |
construct:macro |
定义宏 |
construct:membership-test |
测试一个值是否属于另一个值 |
construct:metatable |
定义元表 |
construct:method-chaining |
串联多个方法调用 |
construct:method-overloading |
使用方法重载 |
construct:method-override |
定义重写的方法 |
construct:method |
定义方法 |
construct:module |
定义模块(代码的分组) |
construct:modulo-assignment |
把求模与赋值结合 |
construct:modulo |
使用求模运算 |
construct:multi-dimensional-array |
使用多维数组 |
construct:multiline-string |
定义多行字符串 |
construct:multiple-assignment |
一次给多个值赋值 |
construct:multiple-dispatch |
使用多重分派 |
construct:multiply-assignment |
把乘法与赋值结合 |
construct:multiply |
使用乘法 |
construct:named-argument |
按名称传递实参 |
construct:namespace |
定义命名空间(代码的分组) |
construct:nested-function |
定义嵌套函数 |
construct:nested-type |
定义嵌套类型 |
construct:nesting |
使用嵌套 |
construct:nint |
使用有符号且与平台相关的整数(32 位或 64 位) |
construct:nuint |
使用无符号且与平台相关的整数(32 位或 64 位) |
construct:null |
使用 null/nil 表示值的缺失 |
construct:nullability |
处理 null/nil 值 |
construct:number |
使用数字(有符号或无符号) |
construct:object-initializer |
通过初始化器设置对象的值 |
construct:octal-number |
用八进制表示法定义数字 |
construct:operator-overloading |
使用运算符重载 |
construct:option |
使用 option 类型 |
construct:optional-parameter |
定义可选形参 |
construct:overflow |
使用算术溢出 |
construct:parameter |
定义形参 |
construct:parenthesized-expression |
用括号括起表达式 |
construct:pattern-matching |
使用模式匹配 |
construct:pattern |
定义用于模式匹配的模式 |
construct:pipe-backward |
使用反向管道 |
construct:pipe-forward |
使用正向管道 |
construct:pipeline |
定义管道 |
construct:point-free |
定义不写出所操作实参的函数 |
construct:pointer |
使用指针 |
construct:postfix-decrement |
用后缀表示法对值进行自减 |
construct:postfix-increment |
用后缀表示法对值进行自增 |
construct:prefix-decrement |
用前缀表示法对值进行自减 |
construct:prefix-increment |
用前缀表示法对值进行自增 |
construct:print |
把值打印到控制台 |
construct:property |
定义属性(getter/setter) |
construct:query-expression |
通过表达式查询数据 |
construct:queue |
使用队列 |
construct:range |
定义范围 |
construct:read-only |
定义只读值 |
construct:record |
定义记录 |
construct:regular-expression |
定义或使用正则表达式 |
construct:result |
使用 result 类型 |
construct:return-type |
定义函数或方法的返回类型 |
construct:return |
从函数/方法中返回 |
construct:sbyte |
使用有符号 8 位整数 |
construct:scientific-notation-number |
用科学计数法定义数字 |
construct:set-comprehension |
通过推导式创建集合 |
construct:set |
使用集合 |
construct:setter |
定义 setter |
construct:short |
使用有符号 16 位整数 |
construct:slice |
使用切片 |
construct:stack |
使用栈 |
construct:static-field |
定义静态字段 |
construct:static-method |
定义静态方法 |
construct:string-formatting |
通过格式字符串构建字符串 |
construct:string-interpolation |
定义插值字符串 |
construct:string |
定义字符串 |
construct:struct |
定义结构体 |
construct:subtract-assignment |
把减法与赋值结合 |
construct:subtract |
使用减法 |
construct:sum-type |
定义和类型 |
construct:switch |
使用switch
|
construct:table |
定义表 |
construct:template-alias |
定义模板的别名 |
construct:template-parameter |
定义模板形参 |
construct:template |
定义模板 |
construct:throw |
抛出异常 |
construct:time |
使用表示时间的对象 |
construct:try |
显式处理异常 |
construct:tuple |
使用元组 |
construct:type-alias |
定义类型的别名 |
construct:type-conversion |
把值转换(强制转换)为另一种类型 |
construct:type-extension |
用新功能扩展类型 |
construct:type-inference |
自动推断值/函数的类型 |
construct:type-test |
测试值是否属于某种特定类型 |
construct:uint |
使用无符号 32 位整数 |
construct:ulong |
使用无符号 64 位整数 |
construct:unary-minus |
使用一元减号 |
construct:unary-plus |
使用一元加号 |
construct:underscored-number |
使用以下划线作为数字分隔符的数字 |
construct:union-type |
定义联合类型 |
construct:user-defined-exception |
定义自定义的、用户定义的异常 |
construct:ushort |
使用无符号 16 位整数 |
construct:using-directive |
使用另一个文件中的代码 |
construct:using-statement |
通过 using 语句赋值并释放值 |
construct:varargs |
定义支持传入零个或多个值的形参 |
construct:variable |
声明变量 |
construct:vector |
使用向量 |
construct:verbatim-string |
使用逐字字符串(不使用转义序列) |
construct:virtual-method |
定义虚方法 |
construct:visibility-modifiers |
指定构造的可见性(例如方法或类) |
construct:while-loop |
使用while循环 |
construct:yield |
在循环中惰性地产出值 |
因为这一类是特定于语言的,所以这里没有常用的标签。