A more generic strategy that doesn't require changing internal tables.
Define two commands:
\newcommand{\semigroup}{(semi\discretionary{-)}{}{)}group}
\newcommand{\digraph}{di\-[rec\-ted~]graph}
For the second one the usual \- suffices. For the first one the more powerful \discretionary is needed:
\discretionary{<prebreak>}{<postbreak>}{<nobreak>}
If a line break (for hyphenation) takes place at the discretionary item, the <prebreak> text will be at the end of the line and the <postbreak> text at the start of the next line; otherwise <nobreak> will be used.
Don't forget to type \semigroup{} if a space follows.
In case you change your mind about \digraph it will be easy to change its definition than hunting through the document for it.
Another definition for \digraph allowing hyphenation after the closing bracket might be
\newcommand{\digraph}{di\-[rec\-ted\discretionary{]-}{}{\kern.3em]}graph}
(there can't be flexible spaces in the <nobreak> text).
I don't think that infrequent "words" such as "(pseudo)scientific" (the full "pseudoscientific" is normally written without a hyphen) warrant a special treatment: it's easier to decide about hyphenation when the text is finished. However, you could make up your personal command:
\makeatletter
\newcommand{\myallowhy}{\nobreak\hskip\z@skip}
\makeatother
\newcommand{\spword}[1]{(#1\discretionary{-)}{}{)}\myallowhy}
and input it as
\spword{pseudo}scientific
The "pseudo" part would never be hyphenated. If that's desired, just change the definition into
\makeatletter
\newcommand{\myallowhy}{\nobreak\hskip\z@skip}
\makeatother
\newcommand{\spword}[1]{(#1\myallowhy\discretionary{-)}{}{)}\myallowhy}
In order to do the same (i.e. retain all hyphenation possibilities) for "(computer-)aided" (hyphenation: com·put·er and aid·ed) with a hard hyphen, one can define
\newcommand{\spwordH}[1]{(#1\myallowhy\discretionary{-)}{}{-)}\myallowhy}
Note: The definition of \myallowhy is modelled on Babel's \allowhyphens that can't be used here, because it's a no-op when the T1 encoding is in force.
Since \nobreak is used after \makeatletter its use is justified.
-\nolinebreak)\hskip0ptand\hyp\nolinebreak)\hskip0pt(with\hypfrom thehyphenatpackage) but ended up with linebreaks before the ")" in some cases. I don't know why. But your\discretionary{-)}{}{-)}with your\myallowhyseems to work. – Lover of Structure Feb 06 '13 at 00:30\nobreakis used after\makeatletterits use is justified."? – Lover of Structure Jun 16 '13 at 11:29\makeatletteron their own initiative should know what they're doing. In particular that\nobreakshould be issued when it's possible to know what mode it will appear in. – egreg Jun 16 '13 at 12:21\makeatletterper se but more about you having a concrete justification (namely, knowledge of the mode not being v-mode) here. – Lover of Structure Jun 17 '13 at 12:35