[Question]
  [
[Identicons](https://en.wikipedia.org/wiki/Identicon) are visual depictions of hash values, often made from symmetrical arrangements of geometric shapes. [Your default Stack Exchange avatar is an identicon.](https://meta.stackexchange.com/q/17443/266052) This challenge is about creating **"wordenticons"**, simple text-based versions of identicons that apply to strings of lowercase letters, i.e. words.
# Challenge
Write a program or function that takes in a string S and outputs its wordenticon. S is guaranteed to be nonempty and only contain lowercase English letter characters a-z. You may optionally assume S has a trailing newline.
The wordenticon of S will be a square grid of text with side lengths `2*length(S)` composed of spaces (), vertical bars, (`|`), and [horizontal bars](http://www.fileformat.info/info/unicode/char/2015/index.htm) (`―`).
To generate the wordenticon of S, form a square grid where every column corresponds to a letter of S (in normal left-to-right reading order) and every row corresponds to a letter of S (in normal top-to-bottom reading order).
For example, if S is `food` our initial grid looks like
```
 food
f....
o....
o....
d....
```
where `.` is just a placeholder.
For every empty point (every `.`) in the grid:
1. If the column letter comes before the row letter alphabetically, replace the `.` with `|`.
2. If the column letter comes after the row letter alphabetically, replace the `.` with [`―`](http://www.fileformat.info/info/unicode/char/2015/index.htm).
3. If the column and row letters are the same, replace the `.` with  (space).
Here is the `food` example after each of these steps:
1. Adding `|`'s:
```
 food
f...|
o|..|
o|..|
d....
```
2. Adding `―`'s:
```
 food
f.――|
o|..|
o|..|
d―――.
```
3. Adding 's:
```
 food
f ――|
o|  |
o|  |
d――― 
```
To complete the wordenticon, remove the superfluous row and column containing the words
```
 ――|
|  |
|  |
――― 
```
then mirror the entire thing horizontally
```
 ――||―― 
|  ||  |
|  ||  |
―――  ―――
```
and finally mirror it again vertically
```
 ――||―― 
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||―― 
```
resulting in the `2*length(S)` side length text grid that is the final wordenticon.
# Examples
Here are some additional wordenticon examples. Note that different words can have identical wordenticons and some wordenticons can be completely made of spaces (unfortunately markdown does not want to render those).
```
food
 ――||―― 
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||―― 
mood
 ――||―― 
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||―― 
foof
 ――  ―― 
|  ||  |
|  ||  |
 ――  ―― 
 ――  ―― 
|  ||  |
|  ||  |
 ――  ―― 
fool
 ―――――― 
|  ||  |
|  ||  |
|――  ――|
|――  ――|
|  ||  |
|  ||  |
 ―――――― 
a [2*2 grid of spaces]
to
 || 
―  ―
―  ―
 || 
it
 ―― 
|  |
|  |
 ―― 
tt [4*4 grid of spaces]
abc
 ―――― 
| ―― |
||  ||
||  ||
| ―― |
 ―――― 
and
 ―――― 
| || |
|―  ―|
|―  ―|
| || |
 ―――― 
but
 ―――― 
| || |
|―  ―|
|―  ―|
| || |
 ―――― 
you
 |||| 
― ―― ―
―|  |―
―|  |―
― ―― ―
 |||| 
bob
 ―  ― 
| || |
 ―  ― 
 ―  ― 
| || |
 ―  ― 
cat
 |――| 
― ―― ―
||  ||
||  ||
― ―― ―
 |――| 
cart
 |――――| 
― ―――― ―
|| ―― ||
|||  |||
|||  |||
|| ―― ||
― ―――― ―
 |――――| 
todo
 |||||| 
― |  | ―
―― ―― ――
― |  | ―
― |  | ―
―― ―― ――
― |  | ―
 |||||| 
mice
 |||||| 
― |||| ―
―― ―― ――
――|  |――
――|  |――
―― ―― ――
― |||| ―
 |||||| 
zyxw
 |||||| 
― |||| ―
―― || ――
―――  ―――
―――  ―――
―― || ――
― |||| ―
 |||||| 
banana
 |―|―||―|―| 
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
|| | || | ||
― ― ―  ― ― ―
 |―|―||―|―| 
codegolf
 ―――――――――――――― 
| ||| |||| ||| |
|― ―――――――――― ―|
|―| ―――――――― |―|
|―|| ――||―― ||―|
| ||| |||| ||| |
|―|||― || ―|||―|
|―||―――  ―――||―|
|―||―――  ―――||―|
|―|||― || ―|||―|
| ||| |||| ||| |
|―|| ――||―― ||―|
|―| ―――――――― |―|
|― ―――――――――― ―|
| ||| |||| ||| |
 ―――――――――――――― 
programming
 ―||―||||||||||||―||― 
| || |||||||||||| || |
―― |―||||||||||||―| ――
――― ―|――――  ――――|― ―――
| || |||||||||||| || |
――――― ―――――――――― ―――――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
―――|―|―― ―||― ――|―|―――
―――|―|||| || ||||―|―――
――― ―|――――  ――――|― ―――
――― ―|――――  ――――|― ―――
―――|―|||| || ||||―|―――
―――|―|―― ―||― ――|―|―――
―――|―|  |―||―|  |―|―――
―――|―|  |―||―|  |―|―――
――――― ―――――――――― ―――――
| || |||||||||||| || |
――― ―|――――  ――――|― ―――
―― |―||||||||||||―| ――
| || |||||||||||| || |
 ―||―||||||||||||―||― 
abcdefghijklm
 ―――――――――――――――――――――――― 
| ―――――――――――――――――――――― |
|| ―――――――――――――――――――― ||
||| ―――――――――――――――――― |||
|||| ―――――――――――――――― ||||
||||| ―――――――――――――― |||||
|||||| ―――――――――――― ||||||
||||||| ―――――――――― |||||||
|||||||| ―――――――― ||||||||
||||||||| ―――――― |||||||||
|||||||||| ―――― ||||||||||
||||||||||| ―― |||||||||||
||||||||||||  ||||||||||||
||||||||||||  ||||||||||||
||||||||||| ―― |||||||||||
|||||||||| ―――― ||||||||||
||||||||| ―――――― |||||||||
|||||||| ―――――――― ||||||||
||||||| ―――――――――― |||||||
|||||| ―――――――――――― ||||||
||||| ―――――――――――――― |||||
|||| ―――――――――――――――― ||||
||| ―――――――――――――――――― |||
|| ―――――――――――――――――――― ||
| ―――――――――――――――――――――― |
 ―――――――――――――――――――――――― 
```
# Scoring
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), the shortest code in bytes wins. Tiebreaker goes to the earlier answer.
# Notes
* Any instance of [horizontal bar](http://www.fileformat.info/info/unicode/char/2015/index.htm) (`―`) in your code may be counted as 1 byte instead of the 3 UTF-8 bytes it actually takes up. (Up to ten instances.)
* If desired you may use regular dashes (`-`) in place of horizontal bars (`―`).
* Removing or adding trailing spaces in the lines of a wordenticon is not allowed (even if the shape remains unchanged). It should be an exact `2*length(S)` side length text square.
* The output wordenticon may optionally have a single trailing newline.
  
[Answer]
# MATL, ~~20~~ 15 bytes
```
'-| 'jtPht!-ZS)
```
Try it at [**MATL Online**](https://matl.io/?code=%27-%7C+%27jtPht%21-ZS%29&inputs=programming&version=18.1.0)
**Explanation**
```
'-| '       % String literal defining the replacement characters
j           % Explicitly grab the input as a string
tP          % Duplicate and reverse the input string (row vector of chars)
h           % Horizontally concatenate the input and it's inverse
t!          % Duplicate and turn into a column vector
-           % Subtract the two vectors (converts to ASCII codes) and we automatically
            % broadcast to create a (2N x 2N) matrix where if the column is
            % later in the alphabet (higher ASCII) we get a positive number, if the 
            % column was earlier (lower ASCII) we get a negative number, and if they are
            % the same letter (same ASCII) we get a 0.
ZS          % sign function which yields -1 for negative, 1 for positive, and 0 for 0;
)           % Use this to index (modulus) into the string literal '-| '. MATL uses 1-based
            % indexing so 0 yields ' ', -1 replaced by '|', and 1 replaced by '-'
            % Implicitly display the result
```
[Answer]
# Java, ~~329~~ ~~305~~ ~~264~~ ~~259~~ 192 bytes
Thanks to:
* @Bálint for suggesting to use ternary operators.
* @user902383 for suggesting to reverse the string myself
* @Frozn and @user902383 for suggesting to replace `StringBuilder` with `String`.
Golfed:
```
String g(String w){char[]a=w.toCharArray();String s="";for(int i=a.length-1;i>=0;s=s+a[i--]);w+=s;a=w.toCharArray();s="";for(char x:a){for(char y:a)s+=(x>y?'|':x<y?'-':' ');s+='\n';}return s;}
```
Ungolfed:
```
String g(String w) {
    char[] a = w.toCharArray();
    String s = "";
    for (int i = a.length - 1; i >= 0; s = s + a[i--]);
    w += s;
    a = w.toCharArray();
    s = "";// To keep the output pure (ie. without the input string as well)
    for (char x : a) {
        for (char y : a)
            s += (x > y ? '|' : x < y ? '-' : ' ');
        s += '\n';
    }
    return s;
}
```
Definitely a fun one. First attempt was a function that was `O(n)` but ended up getting replaced with this simpler form after I got too frustrated.
And, to test:
```
supercalifragilisticexpialidocious
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
----- |----|------- ----|---- -------- ----|---- -------|----| -----
------ ---- ------------ ------------------ ------------ ---- ------
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
------ ---- ------------ ------------------ ------------ ---- ------
---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
|-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
------ ---- ------------ ------------------ ------------ ---- ------
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
-----||----|-------|----|-- -|--------|- --|----|-------|----||-----
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
-----||----|-------|----|-- -|--------|- --|----|-------|----||-----
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
------ ---- ------------ ------------------ ------------ ---- ------
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
----- |----|------- ----|---- -------- ----|---- -------|----| -----
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
|-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
------ ---- ------------ ------------------ ------------ ---- ------
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
------ ---- ------------ ------------------ ------------ ---- ------
----- |----|------- ----|---- -------- ----|---- -------|----| -----
--|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
--- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
-- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
| |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
 -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||-  
```
[Answer]
## Haskell, 93 bytes
```
r=reverse
h x=unlines$(++)<*>r$zipWith(++)<*>map r$(<$>x).((("- |"!!).fromEnum).).compare<$>x
```
Usage example:
```
*Main> putStr $ h "food"
 --||-- 
|  ||  |
|  ||  |
---  ---
---  ---
|  ||  |
|  ||  |
 --||-- 
```
How it works (note: `(f <*> g) x` is defined as `f x (g x)`):
```
((("- |"!!).fromEnum).).compare       -- a function that finds the replacement char
                                      -- for two given chars
   (<$>x).(    )<$>x                  -- map this function for every char in the
                                      -- input over each char. Now we have the
                                      -- first quadrant as a list of strings
zipWith(++) <*> map r                 -- append to each line a reversed copy of itself
(++) <*> r                            -- append a reversed copy of the whole list
unlines                               -- turn into a single string
```
Alternative version: the "find replacement" function `((("- |"!!).fromEnum).).compare` can also be written as `a#b|a<b='-'|a>b='|'|1<2=' '` and called via `(#)` for the same byte count.
[Answer]
# [Jelly](http://github.com/DennisMitchell/jelly), 16 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Om©0_'®Ṡị“-| ”j⁷
```
[Try it online!](http://jelly.tryitonline.net/#code=T23CqTBfJ8Ku4bmg4buL4oCcLXwg4oCdauKBtw&input=&args=ImNvZGVnb2xmIg)
### How it works
```
Om©0_'®Ṡị“-| ”j⁷  Main link. Argument: s (string)
O                 Ordinal; replace the characters of s with their code points.
 m 0              Concatenate the result with a reversed copy.
  ©               Copy the result to the register.
      ®           Yield the list in the register.
    _'            Perform spawned difference of the character codes.
       Ṡ          Apply the sign function.
        ị“-| ”    Index into that string (indices 1, -1, 0).
              j⁷  Join, separating by linefeeds.
```
[Answer]
## JavaScript (ES6), 94 bytes
```
s=>[...s,s].reverse().join``.replace(/./g,(c,_,t)=>t.replace(/./g,d=>d<c?`|`:d>c?`-`:` `)+`
`)
```
Using a dash because I usually run the SpiderMonkey JS shell on Windows and Unicode doesn't work if I do that.
[Answer]
# Pyth, ~~31~~ 30
```
js_BsM_BMclQsm@" |―"._-FCMd*QQ
```
[Test Suite](http://pyth.herokuapp.com/?code=js_BsM_BMclQsm%40%22+%7C%E2%80%95%22._-FCMd%2aQQ&input=%22food%22&test_suite=1&test_suite_input=%22food%22%0A%22mood%22%0A%22foof%22%0A%22fool%22%0A%22a%22%0A%22codegolf%22%0A%22programming%22%0A%22abcdefghijklm%22&debug=0)
Sadly can't drop the `Q`s because of the several bifurcates. Pretty basic algorithm so far, count treats the horizontal bar as 1 byte.
[Answer]
# Haskell, 66 bytes
```
u s|e<-s++reverse s=unlines[["- |"!!min(length[a..b])2|a<-e]|b<-e]
```
[Answer]
# JavaScript ES6, ~~138~~ ~~126~~ 123 bytes
```
s=>(a=(p=[...s]).map(l=>(b=p.map(i=>i<l?"|":i>l?"-":" ").join``)+[...b].reverse().join``)).concat([...a].reverse()).join`
`
```
most of the code is the reflecting / flipping
[Answer]
# J, ~~26~~ 20 bytes
6 bytes thanks to [@Zgarb](https://codegolf.stackexchange.com/users/32014/zgarb).
```
' |-'{~3*@-/~@u:[,|.
```
### Previous 26-byte answer
```
({&' |-')@*@-/~@(3&u:)@,|.
```
Uses the same algorithm as Dennis' answer.
Usage:
```
>> f =: ' |-'{~3*@-/~@u:[,|.
>> f 'food'
<<  --||-- 
   |  ||  |
   |  ||  |
   ---  ---
   ---  ---
   |  ||  |
   |  ||  |
    --||-- 
>> f 'supercalifragilisticexpialidocious'
<<  -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
   |-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   ||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   -----||----|-------|----|-- -|--------|- --|----|-------|----||-----
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ---|-|||||-|||||--|||--||||| || ---- || |||||--|||--|||||-|||||-|---
   -----||----|-------|----|-- -|--------|- --|----|-------|----||-----
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   ||||||||||||||||||||| |||||||||||||||||||||||| |||||||||||||||||||||
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   |-||||||||||||||| |||-||||||||||-||-||||||||||-||| |||||||||||||||-|
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-||--|-| ------||---|--|-|--------|-|--|---||------ |-|--||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   ---|-||-- -|-------||---|--|-|--------|-|--|---||-------|- --||-|---
   ---|-||- |-|| - -- ||-- |- |-| ------ |-| -| --|| -- - ||-| -||-|---
   ---|-|| ||-||| |--|||--|| ||-||------||-|| ||--|||--| |||-|| ||-|---
   ------ ---- ------------ ------------------ ------------ ---- ------
   ----- |----|------- ----|---- -------- ----|---- -------|----| -----
   --|| ||||| |||||--|||-||||||||||----||||||||||-|||--||||| ||||| ||--
   --- -||----|-------| ---|--|-|--------|-|--|--- |-------|----||- ---
   -- |-|||||-|||||--|||- |||||||||----||||||||| -|||--|||||-|||||-| --
   | |||||||||||||||||||-|||||||||| || ||||||||||-||||||||||||||||||| |
    -|||||||||||||| -|||-||||||||||-  -||||||||||-|||- ||||||||||||||- 
```
(`>>` meaning input (STDIN), `<<` meaning output (STDOUT))
[Answer]
# Mathematica, ~~124~~ ~~110~~ ~~104~~ 102 bytes
```
a=Join[#,Reverse@#]&;#<>"
"&/@a@a@Table[{"|"," ","-"}[[c~Order~d+2]],{c,b=Characters@#},{d,b}]<>""&
```
Anonymous function. The Unicode character is U+F3C7 for `\[Transpose]`.
[Answer]
# Javascript ~~146~~ ~~142~~ ~~132~~ ~~130~~ 124 bytes
```
n=>(e=(a=[...n]).map(b=>(d=a.map(c=>c<b?"|":c>b?"-":" ")).concat([...d].reverse()).join``)).concat([...e].reverse()).join`
`
```
Test suite:
```
f=n=>{a=n.split``;e=a.map(b=>a.map(c=>c<b?"|":c>b?"-":" ")).map(d=>d.concat([...d].reverse()).join``);alert(e.concat([...e].reverse()).join`
`)}
f(prompt("Enter string!"));
```
Thanks for @HelkaHomba, for helping to remove at least 50 bytes, and to @Downgoat for 3 bytes!
[Answer]
## Actually, 53 bytes
```
;l╗;∙`♂O♂ii-s3@%" |-"E`MW╜`d@`nkd@Σ'.o@WX'.@s;R+;♂R¥i
```
Once again, Actually's poor string-processing abilities are its kryptonite. It's still shorter than Java, so I have that going for me, which is nice.
[Try it online!](http://actually.tryitonline.net/#code=O2zilZc74oiZYOKZgk_imYJpaS1zM0AlIiB8LSJFYE1X4pWcYGRAYG5rZEDOoycub0BXWCcuQHM7Uis74pmCUsKlaQ&input=InByb2dyYW1taW5nIg)
Explanation:
The code can be separated into 3 distinct portions: the translation code, the processing code, and the mirroring code. For readability, I'm going to explain each section separately.
Translation code (starts with the input string, `s`, on the stack):
```
;l╗;∙`♂O♂ii-s3@%" |-"E`M
;l╗                       push len(s) to reg0 (needed for processing step; we'll call this n)
   ;∙                     cartesian product of s with itself
     `♂O♂ii-s3@%" |-"E`M  map:
      ♂O♂ii                 get a pair of ordinals for the characters
           -s               subtract, signum
             3@%            mod by 3 because element access with negative indices isn't working
                " |-"E      get corresponding string
```
Processing code (starts with a list of `n**2` characters, corresponding to the bottom-right corner):
```
W╜`d@`nkd@Σ'.o@WX
W╜`d@`nkd@Σ'.o@W   while loop (while top of stack is truthy):
 ╜`d@`n              remove n characters from the list
       kd@Σ'.o       concatenate those n characters, and append a period
                X  discard the empty list
```
Mirroring code (starts with a `n**2+n`-length string, with periods acting as newlines)
```
'.@s;R+;♂R¥i
'.@s          split on periods
    ;R+       add the reverse list (vertical mirror)
       ;♂R    make a copy of the list with each string reversed (horizontal mirror)
          ¥   concatenate each pair of strings in the two lists (zip-concat)
           i  flatten list
              (implicitly print each stack item, separated by newlines)
```
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 109 bytes
```
i:0(?\:}
,[r]l\~l2,[r]rl2
1-:?!\$:}l1-[}
~]\  \
&r\l:?!;1-
?!\$:@@:@$:@@:@)}(}"- |"{?$@{?$o~~$}&1-:&
4.>~ao]2
```
Input is via STDIN. [Try it online!](http://fish.tryitonline.net/#code=aTowKD9cOn0KLFtyXWxcfmwyLFtyXXJsMgoxLTo_IVwkOn1sMS1bfQp-XVwgIFwKJnJcbDo_ITsxLQo_IVwkOkBAOkAkOkBAOkApfSh9Ii0gfCJ7PyRAez8kb35-JH0mMS06Jgo0Lj5-YW9dMg&input=Zm9vZA)
**Explaination:**
The input it read and mirrored on the first line. For input `abcd`, this leaves `dcbaabcd` on the stack. Each half is then mirrored to give `abcddcba` (line 2). Then, each element is duplicated and left on its own stack in turn (lines 3 and 4). After this process, the stack of stacks looks a little like this:
```
aabcddcba  <-- top of the stack of stacks
b
c
d
d
c
b
a          <-- bottom of the stack of stacks
```
For each stack in turn, the row value (the bottom of the stack) is compared to the column value (the top of the stack). The appropriate character is selected from `- |` and written to STDOUT. The column values are then rotated so that the next column is at the top of the stack (line 6).
Once all the columns have been considered, the row value is discarded, a newline printed, and the column values put onto the previous stack (line 7), for the output process to start again.
The `]` command, in addition to popping from the stack of stacks, empties the current stack if it is the only one left. The program's end condition is if the stack is empty, as all rows have been processed (line 5).
[Answer]
# C# ~~166~~ 143 bytes,
```
using System.Linq;s=>string.Join("\n",(s+=string.Concat(s.Reverse())).Select(x=>s.Aggregate("",(c, y)=>c+"- |"[Math.Sign(x.CompareTo(y))+1])));
```
### Explanation:
```
using System.Linq;
s=>                                     // Expression bodied member allows for implicit return
  string.Join("\n",                     // Join the generate lines into the final output
    (s+=string.Concat(s.Reverse()))     // Combine s and its reverse inline so aggregate has the whole line
        .Select(x=>                     // For each character in the line run the aggregate to generate its row
            s.Aggregate("",             // Empty string is required to cooerce the output type from char
                (c, y)=>                // c is the generated string so far, y is the next character
                        c+
                                        // Compare the two letters here (row to column)
                                        // Then take the sign of the result to collapse to -1, 0, or 1
                                        // Finally add 1 to line it up with the indexes of the constant string;                                             
                        "- |"[Math.Sign(x.CompareTo(y))+1]
)));
```
Test: 
```
Wordenticons
 |||||||||||||||||||||| 
- -|||-|| |--| ||-|||- -
-| |||-||||--||||-||| |-
--- ----|------|---- ---
---| ---|------|--- |---
---|| -||- -- -||- ||---
-||||| |||||||||| |||||-
---||-- |------| --||---
-------- ------ --------
- -|||-|| |--| ||-|||- -
---|| -||- -- -||- ||---
-|||||-||||  ||||-|||||-
-|||||-||||  ||||-|||||-
---|| -||- -- -||- ||---
- -|||-|| |--| ||-|||- -
-------- ------ --------
---||-- |------| --||---
-||||| |||||||||| |||||-
---|| -||- -- -||- ||---
---| ---|------|--- |---
--- ----|------|---- ---
-| |||-||||--||||-||| |-
- -|||-|| |--| ||-|||- -
 |||||||||||||||||||||| 
```
[Answer]
## CJam, 20 bytes
```
l_W%+_ff{-g" |―"=}N*
```
[Test it here.](http://cjam.aditsu.net/#code=l_W%25%2B_ff%7B-g%22%20%7C%E2%80%95%22%3D%7DN*&input=codegolf)
Uses the obvious approach of computing an outer product and using difference and *sgn* to compute the character in each cell.
[Answer]
## C#, ~~169~~ 150 bytes
thanks FryAmTheEggman
```
void f(string s){s+=new string(s.Reverse().ToArray());foreach(char c in s){var t="";foreach(char k in s)t+=c==k?" ":c>k?"|":"-";Console.WriteLine(t);}
```
ungolfed:
```
    public static void f(string s)
    {
        s += new string(s.Reverse().ToArray());
        foreach (char c in s)
        {
            var t="";
            foreach (char k in s)
            t+=c==k?" ":c>k?"|":"-";
            Console.WriteLine(t);
        }
    }
```
more golfing advice appreciated
[Answer]
## Clojure, 171 bytes
```
(fn[w](let[f concat r reverse p(map #(f %(r %))(partition(count w)(for[x w y w :let[c(compare x y)]](if(neg? c)\-(if(pos? c)\|\ )))))](run! #(apply println %)(f p(r p)))))
```
ungolfed:
```
(fn [w]
  (let [n (count w)
        a (for [x w y w
                :let [c (compare x y)]]
            (if (neg? c)
              \-
              (if (pos? c)
                \|
                \ )))
        p (map #(concat % (reverse %))(partition n a))
        p (concat p (reverse p))]
    (run! #(apply println %) p))))
```
[Answer]
# J, ~~75~~ 70 bytes
5 bytes saved thanks to Dennis.
```
3 :'(],.|:@|.@|:)(],|.)''- |''{~]([:-.@*(,~@#$])-(,~@#$(##])@]))3 u:y'
```
I'll work on converting it into a tacit verb later.
[Answer]
# Octave, 39 bytes
```
@(x)'| -'(sign([x,y=flip(x)]-[x y]')+2)
```
Creates an anonymous function that is able to be run using `ans('string')`.
[**Demo**](http://ideone.com/U55cMz)
**Explanation**
This solution combines the input string (`x`) and it's inverse (`flip(x)`) using `[x, flip(x)]`. The inverse is assigned to `y` to shorten the answer, `[x, y = flip(x)]`. We then create a column vector of the same thing by combining `x` and `y` and taking the transpose: `[x,y]'`. Then we take the difference which will automatically broadcast to create a 2D array of differences between any ASCII representations of letters in the strings. We use `sign` to make these either `-1`, `0`, or `1` and then add `2` to get valid 1-based index values. We then use these to index into the initial string `'| -'`.
[Answer]
## Julia, 70 bytes
This is my first attempt at code golf and I have not used Julia before, so tell me what you think:
```
f(s)=join([join([r>c?'|':r<c?'―':' 'for c=s])for r=s*=reverse(s)],"
")
```
[Try it online!](http://julia.tryitonline.net/#code=ZihzKT1qb2luKFtqb2luKFtyPmM_J3wnOnI8Yz8n4oCVJzonICdmb3IgYz1zXSlmb3Igcj1zKj1yZXZlcnNlKHMpXSwiCiIpCgpzdHJpbmdzID0gWyJmb29kIiAibW9vZCIgImhvcGUiICJiYW5hbmEiICJjb2RlZ29sZiIgInByb2dyYW1taW5nIiAiYWJjZGVmZ2hpamtsbSIgInN1cGVyY2FsaWZyYWdpbGlzdGljZXhwaWFsaWRvY2lvdXMiXQoKZm9yIHMgaW4gc3RyaW5ncwogICAgcHJpbnRsbigiJHNcblxuJChmKHMpKVxuIikKZW5k&input=&debug=on)
Ungolfed:
```
function wordenticon(word::AbstractString)
    word*=reverse(word)
    join([
        join([
            if r>c
                '|'
            elseif r<c
                '―'
            else
                ' '
            end
            for c in word
        ])
        for r in word]
        ,"\n"
    )
end
```
I think it could probably be made shorter. This code stores the characters of the wordicon in a matrix:
```
f(s)=[r>c?'|':r<c?'―':' 'for r=s*=reverse(s),c=s]
```
Unfortunately, I couldn't manage to produce the desired output using the matrix.
[Answer]
# [R](https://www.r-project.org/), 101 bytes
101 bytes since I'm using `―` (which I think looks better than `-`).
```
function(s)write(c("|"," ","―")[sign(outer(g<-c(r<-utf8ToInt(s),rev(r)),g,"-"))+2],"",2*nchar(s),,"")
```
[Try it online!](https://tio.run/##FYsxDgIxDAR7XhG5ssFprqLIB@jpEAUKSUgTSz6Hayj4BB/kIyEUq9WsZnVkF7wbubdoVRqutGm1hBHhBQxu5vv@AF3WWhpKt6RYgo@owXfLx7Ocms0Xa3qiEnFh8EB0WK4MwMu@xcdN/8JEGhnBBGg3O4vc5/ID "R – Try It Online")
I was surprised there wasn't an R answer before since we can exploit the symmetry and R's matrices to get a quite competitive answer, despite this being a `string` problem.
### Ungolfed Explanation:
```
function(s){
 r <- utf8ToInt(s)               # turn to vector of ints (charcodes)
 g <- c(r, rev(r))               # concatenate r and its reverse
 idx <- sign(outer(g,g,"-")) + 2 # compute all differences and their signs.
                                 # -1=>less than, 0=>equal, +1=>greater than
                                 # add 2 to make them 1-based indices into the vector
 write(c("|"," ","―")[idx],"",2*nchar(s),,"")
     # write the vector of characters to stdout "" with line width 2*nchar(s)
     # and no separator
}
```
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal) `j`, 23 bytes
```
Ẋƛḣ>[\||ḣ=‛- $i];?Lẇvmm
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=j&code=%E1%BA%8A%C6%9B%E1%B8%A3%3E%5B%5C%7C%7C%E1%B8%A3%3D%E2%80%9B-%20%24i%5D%3B%3FL%E1%BA%87vmm&inputs=lyxal&header=&footer=)
[Answer]
# Jolf, 42 bytes
Hardly golfed. I'm probably forgetting about a matrix builtin that Jolf has.
```
ΆΖR~mGiEd+γR~mGiEΨ."| -"hmA-~@ά~@HE_γSSZiζ
```
[Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=zobOllJ-bUdpRWQrzrNSfm1HaUXOqC4ifCAtImhtQS1-QM6sfkBIRV_Os1NTWmnOtg&input=zobOllJ-bUdpRWQrzrNSfm1HaUXOqC4ifCAtImhtQS1-QM6sfkBIRV_Os1NTWmnOtg) This code uses an arrow function (`Ψ`) for the matrix map.
[Answer]
**Javascript, 303 Bytes**
```
function w(o){function r(o){var r=Array.prototype.slice.call(o).reverse();console.log(o.join("")+r.join(""))}var e,n,c,h=[],s=o.length;for(e=0;s>e;e++){for(h.push([]),n=0;s>n;n++)c=o.charCodeAt(n)-o.charCodeAt(e),0===c?h[e].push(" "):0>c?h[e].push("|"):h[e].push("-");r(h[e])}for(e=s-1;e>=0;e--)r(h[e])}
```
Ungolfed
```
function w(s) {
    var arr = [],
        l = s.length, r, c, x;
    for (r = 0; r < l; r++) {
        arr.push([]);
        for (c = 0; c < l; c++) {
            x = s.charCodeAt(c) - s.charCodeAt(r);
            if (0 === x) {
                arr[r].push(' ');
            } else if (x<0) {
                arr[r].push('|');
            } else {
                arr[r].push('-');
            }
        }
        out(arr[r]);
    }
    for (r = l - 1; r>=0; r--) {
        out(arr[r]);
    }
    function out(r){
        var rev = Array.prototype.slice.call(r).reverse();
        console.log(r.join('') + rev.join(''));
    }
}
```
No ecma 2015 fanciness here
[Answer]
## Python 2, 126 bytes
```
def f(s):x=[''.join(" -|"[cmp(ord(a),ord(b))]for a in s)for b in s];y=[a+b[::-1]for a,b in zip(x,x)];print'\n'.join(y+y[::-1])
```
This is essentially a port of my [Actually solution](https://codegolf.stackexchange.com/a/80763/45941).
[Try it online](http://ideone.com/fork/Ac65Rp)
Explanation:
```
x=[''.join(" -|"[cmp(ord(a),ord(b))]for a in s)for b in s] # get the correct character for each pair of characters in the Cartesian product of s with itself, and concatenate the characters in each line
y=[a+b[::-1]for a,b in zip(x,x)] # mirror each line horizontally
print'\n'.join(y+y[::-1]) # mirror vertically and print
```
[Answer]
# Python 3.5, ~~250~~ ~~223~~ 175 bytes:
```
def H(o):O=ord;G=len(o);p=[[' ―'[O(i)<O(g)],'|'][O(i)>O(g)]for i in o for g in o];u='\n'.join([''.join(p[i:G+i]+p[i:G+i][::-1])for i in range(0,len(p),G)]);print(u+'\n'+u[::-1])
```
[Try It Online! (Ideone)](http://ideone.com/7jR6bZ) (The last two test cases won't show up in the output since they are just blank lines. My program is processing them though, which is confirmed the fact that there are 10 cases input, but only 8 outputs appear.)
## Ungolfed followed by an Explanation:
```
def H(o):
    O=ord
    G=len(o)
    p=[[' ―'[O(i)<O(g)],'|'][O(i)>O(g)]for i in o for g in o]
    u='\n'.join([''.join(p[i:G+i]+p[i:G+i][::-1])for i in range(0,len(p),G)])
    print(u+'\n'+u[::-1])
```
1. `p=[[' ―'[O(i)<O(g)],'|'][O(i)>O(g)]for i in o for g in o]`
Create a list, `p`, where a `|` is added if the Unicode Point Value of the column letter is less than the row letter's value, a `–` is added if the Unicode Point Value of the column letter is more than the row letter's value, or a  if both values are equal.
2. `u='\n'.join([''.join(p[i:G+i]+p[i:G+i][::-1])for i in range(0,len(p),G)])`
Create a newline joined string, `u`, from list `p` by splitting it into joined string segments each consisting of input length number of characters both forwards and backwards, resulting in each one having the length of 2 times how ever many characters there are in the input. This is the top half of your wordenticon. So, in the case of your input being `food`, this would return:
```
 ――||―― 
|  ||  |
|  ||  |
―――  ―――
```
3. `print(u+'\n'+u[::-1])`
Finally, output `u` followed by a newline and then `u` reversed to vertically mirror the first half for the second half. This is your completed wordenticon, which for the test case `food` would finally be:
```
 ――||―― 
|  ||  |
|  ||  |
―――  ―――
―――  ―――
|  ||  |
|  ||  |
 ――||―― 
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~20~~ ~~22~~ ~~21~~ ~~19~~ 13 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
δ.S… |—sèJ»º∊
```
+2 bytes as bug-fix for single-char inputs (but later on -2 again by putting the fix at a different position in the code)  
-7 bytes thanks to *@ovs*.
Takes the input as a list of characters.
[Try it online](https://tio.run/##yy9OTMpM/f//3Ba94EcNyxRqHjVMKT68wuvQ7kO7HnV0/f8frZSmpKOUD8UpSrEA) or [verify all test cases](https://tio.run/##yy9OTMpM/V@m5JlXUFpipaBkX6nDpeRfWgLh6VQGu/w/t0Uv@FHDMoWaRw1Tig@v8Dq0@9CuRx1d/3UObbP/H62Ulp@foqSjlAuhgLw0CJUDpBKBuCQfSGSWgFggIjEpGUTmgRQnlYJEKvNLQez8JCCZnFgCJovA6vNTQHpzM5NTgVRVZUU5SF1iHhCCFOWnpKbn54BsKyjKTy9KzM3NzEuH2JCSmpaekZmVnZOrFAsA).
**Explanation:**
```
δ              # Apply double-vectorized on the (implicit) input-list:
 .S            #  Compare the characters (-1 if a<b; 0 if a==b; 1 if a>b)
   … |—        # Push string " |—"
       sè      # Index the -1,0,1 of the matrix into this string
         J     # Join each inner list together to a string
          »    # Join this list of strings by newlines
           º   # Mirror each line left to right
            ∊  # And mirror the entire block top to bottom
               # (and output the result implicitly)
```
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 24 bytes
```
⍪∘⊖⍨⍤,∘⌽⍨' |―'⊇⍨∘.(≠+<)⍨
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/qG@qp/@jtgkG/x/1rnrUMeNR17RHvSse9S7RAXF69gI56go1jxqmqj/qagfJdMzQ03jUuUDbRhPI@58G1Pqot@9RV/Oj3jWPerccWm/8qG0i0NDgIGcgGeLhGfw/TUE9LT8/RZ0LyFAAk7moXKBsGio3B4lbUJSfXpSYm5uZl64OAA "APL (Dyalog Extended) – Try It Online")
Uses Extended for character comparison.
minus a lot of bytes from Adám.
uses `⎕IO←0` (0-indexing)
## Explanation(old)
```
{(⊢⍪⊖)(⊢,⌽)' |―'[∘.{1+⍺(≠+<)⍵}⍨⍵]} ⍵ → input.
                 ∘.           ⍨⍵   cartesian product of ⍵, with the following function:
                   {1+⍺(≠+<)⍵}     return 1 if equal, 2 if greater, 3 if lesser.
           ' |―'[               ]  index into the required characters
      (⊢,⌽)                        append the reverse of the pattern
 (⊢⍪⊖)                             append the y-axis reverse of the pattern
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal/tree/version-2), 14 bytes
```
mC:ǒ-±` |-`İṠ⁋
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2&c=1#WyIiLCIiLCJtQzrHki3CsWAgfC1gxLDhuaDigYsiLCIiLCJwcm9ncmFtbWluZyJd)
```
m              # Mirror
 C             # Get charcodes
  :ǒ-          # Outer product by subtraction
           İ   # Index
     ±         # Signs of those differences
      ` |-`    # Into " |-"
            Ṡ⁋ # Concatenate and join on newlines
```
[Answer]
# [Perl 5](https://www.perl.org/) `-F`, 76 bytes
```
say@$_,reverse@$_ for(@;=map{//;[map{($",'-','|')[$_ cmp$']}@F]}@F),reverse@
```
[Try it online!](https://tio.run/##K0gtyjH9/784sdJBJV6nKLUstag4FchUSMsv0nCwts1NLKjW17eOBtEaKko66rrqOuo16prRQCXJuQUq6rG1Dm4grAnX/P9/Sf6//IKSzPy84v@6vqZ6BoYG/3XdAA "Perl 5 – Try It Online")
]