Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

render_example_test.gno

1.09 Kb · 42 lines
 1package soundexdemo
 2
 3// ExampleRender pins the realm's root Render output as a testable example.
 4func ExampleRender() {
 5	print(Render(""))
 6	// Output:
 7	// # Soundex
 8	//
 9	// Phonetic keys for English names, demoing the [`p/moul/x/daily/soundex`](/p/moul/x/daily/soundex/v0) library.
10	//
11	// | name | key |
12	// |---|---|
13	// | Robert | `R163` |
14	// | Rupert | `R163` |
15	// | Rubin | `R150` |
16	// | Ashcraft | `A261` |
17	// | Ashcroft | `A261` |
18	// | Tymczak | `T522` |
19	// | Pfister | `P236` |
20	// | Honeyman | `H555` |
21	//
22	// ## Sounds alike
23	//
24	// - **R163**: Robert, Rupert
25	// - **A261**: Ashcraft, Ashcroft
26	//
27	// > A *blocking* key for finding candidates, never proof that two names match.
28}
29
30// ExampleRender_noLetters pins the empty-key path: an input with no ASCII
31// letters has no Soundex key at all, and must not be reported as matching.
32func ExampleRender_noLetters() {
33	print(Render("/12345"))
34	// Output:
35	// # Soundex
36	//
37	// Phonetic keys for English names, demoing the [`p/moul/x/daily/soundex`](/p/moul/x/daily/soundex/v0) library.
38	//
39	// ## `12345`
40	//
41	// _No ASCII letters — no key._
42}