 
   conditional_titlecase = [@letter_i]
 
-  for {codepoint, _upper, _lower, title} <- codes,
-      title && title != codepoint,
-      codepoint not in conditional_titlecase do
-    def titlecase_once(unquote(codepoint) <> rest, _mode) do
+  {singles, tables} =
+    compute_lookup.(
+      for {codepoint, _upper, _lower, title} <- codes,
+          title && title != codepoint,
+          codepoint not in conditional_titlecase,
+          do: {codepoint, title}
+    )
+
+  for {codepoint, title} <- singles do
+    def titlecase_once(<<unquote(codepoint), rest::bits>>, _mode) do
       {unquote(title), rest}
     end
   end
 
+  for {prefix, clauses} <- tables do
+    def titlecase_once(<<unquote(prefix), byte, rest::bits>>, _mode) do
+      value = case byte, do: unquote(clauses)
+      {value, rest}
+    end
+  end
+
   def titlecase_once(<<char::utf8, rest::binary>>, _mode) do
-    {<<char::utf8>>, rest}
+    if char >= ?a and char <= ?z do
+      {<<char - 32::utf8>>, rest}
+    else
+      {<<char::utf8>>, rest}
+    end
   end
 
   def titlecase_once(<<char, rest::binary>>, _mode) do

        )
    end)

  # Sigma variants for Greek
  @letter_sigma <<0x03A3::utf8>>
  @letter_small_sigma_final <<0x03C2::utf8>>


  conditional_upcase = [@letter_i]

  {singles, tables} =
    compute_lookup.(
      for {codepoint, upper, _lower, _title} <- codes,
          upper && upper != codepoint,
          codepoint not in conditional_upcase,
          do: {codepoint, upper}
    )

  for {codepoint, upper} <- singles do
    def upcase(<<unquote(codepoint), rest::bits>>, acc, mode) do
      upcase(rest, [unquote(upper) | acc], mode)
    end
  end

  for {prefix, clauses} <- tables do
    def upcase(<<unquote(prefix), byte, rest::bits>>, acc, mode) do
      value = case byte, do: unquote(clauses)
      upcase(rest, [value | acc], mode)
    end
  end

  def upcase(<<byte, rest::bits>>, acc, mode) do
    if byte >= ?a and byte <= ?z do
      upcase(rest, [byte - 32 | acc], mode)
    else
      upcase(rest, [byte | acc], mode)
    end
  end

  def upcase("", acc, _mode), do: IO.iodata_to_binary(:lists.reverse(acc))
