[Question]
  [
An [Abjad](https://en.wikipedia.org/wiki/Abjad) is a writing system where each symbol stands for a consonant, and where vowels are omitted. An impure Abjad is an abjad in which there are additionals symbols for vowels, usually diacritics.
Write a program or function that, given a string of lowercase text (i.e. nothing but ASCII letters from `a` to `z`, commas and spaces), outputs a corresponding impure abjad English transcript with the following rules:
### Representation of vowels
Each vowel (i.e. `a e i o u`) is represented as an accent on the immediately preceding consonant. For instance, assuming the accent representing the vowel `e` is `́`, the word `wet` will be transcribed as `ẃt`.
If a vowel is not preceded by a consonant (two or more vowels in a row, or a word starting with a vowel), the symbol `o` is used as a "blank consonant". For example, the word `peep` will be transcribed as `ṕóp`
### Accent placement
Consonants that have ascenders are unpleasant to read when accentuated. Therefore, for those consonants, the symmetric accent will be displayed below the symbol instead of above. For instance, the letter combination `te` will be written `t̖` rather than `́t`
Those consonants are `b d f h k l t`.
### Accents for vowels
We are using Unicode combining characters to display accents on every consonant possible. The combining characters used can be found [here](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). Combining accents are placed directly after the symbol they are to be put on.
The accents are presented on arbitrary consonants in this list.
* **a**
Above accent: U+0x0304, example: `c̄`
Below accent: U+0x0320, example: `d̠`
* **e**
Above accent: U+0x0301, example: `ć`
Below accent: U+0x0316, example: `d̖`
* **i**
Above accent: U+0x0307, example: `ċ`
Below accent: U+0x0323, example: `ḍ`
* **o**
Above accent: U+0x030c, example: `č`
Below accent: U+0x032d, example: `ḓ`
* **u**
Above accent: U+0x0311, example: `c̑`
Below accent: U+0x032e, example: `d̮`
Here is the list of all possible characters:
```
b̠ b̖ ḅ b̭ b̮
c̄ ć ċ č c̑
d̠ d̖ ḍ ḓ d̮
f̠ f̖ f̣ f̭ f̮
ḡ ǵ ġ ǧ g̑
h̠ h̖ ḥ h̭ ḫ
j̄ j́ j̇ ǰ j̑
k̠ k̖ ḳ k̭ k̮
l̠ l̖ ḷ ḽ l̮
m̄ ḿ ṁ m̌ m̑
n̄ ń ṅ ň n̑
p̄ ṕ ṗ p̌ p̑
q̄ q́ q̇ q̌ q̑
r̄ ŕ ṙ ř ȓ
s̄ ś ṡ š s̑
t̠ t̖ ṭ ṱ t̮
v̄ v́ v̇ v̌ v̑
w̄ ẃ ẇ w̌ w̑
x̄ x́ ẋ x̌ x̑
ȳ ý ẏ y̌ y̑
z̄ ź ż ž z̑
ō ó ȯ ǒ ȏ
```
### Test cases
* Input: `programming puzzles and code golf`
Output: `přgr̄mṁng p̑zzl̖s ōnd čd̖ ǧlf`
* Input: `the quick brown fox jumps over the lazy dog`
Output: `th̖ q̑ȯck břwn f̭x j̑mps ǒv́r th̖ l̠zy ḓg`
* Input: `beautiful`
Outpu: `b̖ōȏṭf̮l`
* Input: `one ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them`
Output: `ǒń ṙng ṱ ȓl̖ th̖m ōll, ǒń ṙng ṱ f̣nd th̖m, ǒń ṙng ṱ bṙng th̖m ōll ōnd ȯn th̖ d̠rkńss ḅnd th̖m`
### Scoring
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest program or function in bytes wins.
  
[Answer]
# GNU sed, 168 158 134 105 98 85 byt̖s
ǒr 75 ch̠rs (b̭th ȯncl̮ḍng +1 f̭r th̖ `-r` fl̠g).
```
s/([bdfhklt])([aeiou])/\1\u\2/g;y/aeiouAEIOU/̠̖̣̭̮̄́̇̌̑/;s/\B[^ ,a-z]/o&/g
```
### óxpl̠n̄ṭǒn
Wó s̄v́ ō ḅt ȏṡng th̖ čnstr̄ȯnt th̠t ȯnp̑t ȯs ōll ḽẃr-c̄ś. Wó ȏpc̄ś ōny v̌ẃl f̭lḽẇng ō čnšn̄nt, b̖f̭ŕ čnv́rṭng ōll v̌ẃls ṱ ōcćnts.
```
#!/bin/sed -rf
s/([bdfhklt])([aeiou])/\1\u\2/g  # upcase vowel following ascender
y/aeiouAEIOU/̠̖̣̭̮̄́̇̌̑/
s/\B[^ ,a-z]/o&/g                # precede with 'o' if needed
```
Th̖ ǒdd-ḽǒḳng ch̠r̄ct̖rs ōŕ `//` čnt̠ȯṅng ōll t̖n ōcćnts (`/̠̖̣̭̮̄́̇̌̑/`). óxp̄nd̖d ǒȏt ẇth sp̄ćs, th̖y w̌ȏld ḽǒk ḷk̖ `/ ̄ ́ ̇ ̌ ̑ ̠ ̖ ̣ ̭ ̮ /`.
### ǒȏtp̑t
> 
> 
> ```
> přgr̄mṁng p̑zzl̖s ōnd čd̖ ǧlf
> th̖ q̑ȯck břwn f̭x j̑mps ǒv́r th̖ l̠zy ḓg
> b̖ōȏṭf̮l
> ǒń ṙng ṱ ȓl̖ th̖m ōll, ǒń ṙng ṱ f̣nd th̖m, ǒń ṙng ṱ bṙng th̖m ōll ōnd ȯn th̖ d̠rkńss ḅnd th̖m
> 
> ```
> 
> 
[Answer]
# CJam, ~~63~~ 62 bytes
```
Qq{_"aeiou"#:I){;___eu='o*\"bdfhklt"&"F<IST""*'-27"?I=730+}&}/
```
Try it online in the [CJam interpreter](http://cjam.aditsu.net/#code=Qq%7B_%22aeiou%22%23%3AI)%7B%3B___eu%3D'o*%5C%22bdfhklt%22%26%22F%3CIST%22%22*'-27%22%3FI%3D730%2B%7D%26%7D%2F&input=programming%20puzzles%20and%20code%20golf).
### How it works
```
Qq             e# Push an empty string and read from STDIN.
{              e# For each character in the input:
               e#   Push a copy of the character.
  "aeiou"#     e#   Find its index in "aeiou" (-1 for not found).
  :I)          e#   Save in I and add 1.
  {            e#   If I + 1 != 0:
    ;          e#     Discard the character.
    ___        e#     Copy the previous character (or the empty array) three times.
    eu=        e#     Convert the last copy to uppercase and check for equality.
               e#     This pushes 1 for non-letters and 0 for letters.
    'o*        e#     Push a string of that many o's.
    \          e#     Swap the last copy with the string of o's.
    "bdfhklt"& e#     Intersect with that string.
    "F<IST"    e#     Push that string.
    "*'-27"    e#     Push that string.
    ?          e#     Select the first iff the intersection is non-empty.
    I=         e#     Retrieve the character at index I.
    730+       e#     Add 730 to its code point.
  }&           e#
}/             e#
```
[Answer]
# [Ŕṭn̄ 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 71 byt̖s
```
T`aei\ou`̄́̇̌̑
T`̄́̇̌̑`̠̖̣̭̮`[bdfhklt]*.
+`([^a-z])([̠̖̣̭̮̄́̇̌̑])
$1o$2
```
[Try ȯt ǒnḷń!](https://tio.run/##VY6xTsMwEIZ3P8UNHVoVKsGzdEuDbNfn1MTxBcemkA0JiYWFhRmJuX2Se6fQFFDb7e7@77//j5hcUMOwlArdirLkV37hN37nD7E8WyR/8Sd/8473stDGbmqfyvlCzOW0uFPXfTmbFif6BJczMbmhye0wtJGqqJrGhQra3PceO1DBwJoMQkXeCpE2CA/ZrWvQkbYBLD3BfW7aDugRI4yyV/0zGKqE0KhycjZ7ISggxPFvIojZ40g2oLy/gnPJukPcKF2e9e/wZzl2cuEYZlSsA3Yd6H/nDw "Retina 0.8.2 – Try It Online")
### Óxpl̠n̄ṭǒn
```
T`aei\ou`̄́̇̌̑          ŕpl̠ćs th̖ ch̠r̄ct̖rs aeiou ẇth th̖ črŕsp̌nṡng ḍōcṙṭcs ōb̭v́.
T`̄́̇̌̑`̠̖̣̭̮`[bdfhklt]+.    ŕpl̠ćs th̖ ḍōcṙṭcs ōb̭v́ ẇth ḍōcṙṭcs b̖ḽw ȯf pŕćd̖d by ǒń ǒr śv́r̄l ch̠r̄ct̖rs ẇth ōsćnd̖rs.
+`([^a-z])([̠̖̣̭̮̄́̇̌̑])     ȏnṭl th̖ ȯnp̑t sṱps ch̠nġng, ŕpl̠ć óv́ry ḍōcṙṭc ňt pŕćd̖d by ō l̖tt̖r...
$1o$2              ...ẇth th̖ s̄ḿ ch̠r̄ct̖rs b̮t ẇth ōn o b̖tẃón th̖m.
```
[Answer]
# Julia, 269 bytes
This is really long and can probably be golfed further, but I'm just psyched that I was able to come up with a working solution at all!
```
s->(u=700+[72,69,75,80,85];l=800+[0,-10,3,13,14];R=replace;r(m)=(i=findin("aeiou",m[2])[1];j=m[1]∈"bdfhklt"?l[i]:u[i];string(m[1],char(j)));t(m)=string("o",char(u[findin("aeiou",m)[1]]));R(R(R(s,r"(?![eiou])[b-z][aeiou]",r),r"(?<=^| )[aeiou]",t),r"(?<=\S)[aeiou]",r))
```
This creates an unnamed function that accepts a string and returns a string.
Ungolfed + explanation:
```
function f(s)
    # Construct arrays of integers representing the unicode accents
    # u is for the upper accents and l is for the lower
    u = 700 + [72,69,75,80,85]
    l = 800 + [0,-10,3,13,14]
    # Define a function to accent consonants followed by vowels
    r(m) = begin
        # m is the consonant-vowel pair from the regex match
        i = findin("aeiou", m[2])[1]
        j = m[1] ∈ "bdfhklt" ? l[i] : u[i]
        string(m[1], char(j))
    end
    # Define a function to accent vowels
    t(m) = string("o", char(u[findin("aeiou", m)[1]]))
    # Accent consonants
    rep1 = replace(s, r"(?![eiou])[b-z][aeiou]", r)
    # Accent vowels at the start of a string or before a space
    rep2 = replace(rep1, r"(?<=^| )[aeiou]", t)
    # Accent remaining unaccented vowels
    rep3 = replace(rep2, r"(?<=\S)[aeiou]", t)
    # Return
    rep3
end
```
Examples:
```
julia> println(f("beautiful"))
b̖ōȏṭf̮l
julia> println(f("programming puzzles and code golf"))
přgr̄mṁng p̑zzl̖s ōnd čd̖ ǧlf
```
Note that if you look at the raw text in the post, the "t" in the first example is accented correctly but for some reason it doesn't display that way in the rendered markdown, at least for me.
]