Elamur Research

Detecting grammar errors with Lingsoft's Swedish grammar checker

Paper · 2000 · Juhani Birn

Summary

A grammar checker must recognize mistakes without treating every unusual sentence as wrong. That balance is particularly difficult when the information needed to identify an error is itself affected by the error. A word may have several grammatical interpretations, and the interpretation that makes a sentence appear well formed may conceal what the writer actually intended. Juhani Birn’s paper examines this problem through Grammatifix, Lingsoft’s Swedish grammar checker. It explains how the system adapts Constraint Grammar, a framework for resolving grammatical ambiguity, to detect selected kinds of errors in ordinary text.

Grammatifix does not attempt to describe everything that can go wrong in Swedish. Its grammatical checks concentrate on recurring constructions that can be specified with reasonable precision. Important examples include agreement inside noun phrases and compatibility between forms in a verb sequence. The grammatical detector also belongs to a larger product: writing conventions and stylistically marked vocabulary receive separate treatment. The paper concerns grammatical error correction in the narrower sense of identifying context-dependent grammatical problems, explaining them, and sometimes proposing a replacement.

The detector processes text through successive stages. It identifies lexical units, obtains possible grammatical readings from the SWETWOL analyzer, and uses Swedish Constraint Grammar rules to reduce ambiguity. It then attaches the alternatives @ERR and @OK to the surviving readings. Application-specific rules select @ERR when their contextual requirements are satisfied; words left unselected receive @OK. The described implementation contains 659 error-selection rules. Each error rule is connected to a message that can name the problem, explain the relevant grammatical restriction, and specify a correction. Though the system uses grammatically informative context, it does not consume the output of a separate syntactic parser. Instead, each rule performs the limited structural analysis needed for its particular check.

Much of the contribution concerns reliability rather than the basic ability to recognize an agreement mismatch. Grammatically incorrect input can mislead disambiguation, so Grammatifix sometimes checks particular written forms, sometimes accepts a controlled range of remaining interpretations, and sometimes changes the disambiguation rules themselves. False alarms receive equally detailed attention. Rules initially designed to capture broad error patterns are refined against published text, where names, fixed expressions, clause boundaries, and omitted material can make apparently suspicious sequences legitimate. The paper presents this as a continuing compromise: suppressing every questionable warning would also suppress useful detections.

The reported evaluation makes the scope of that compromise visible. On a previously unused Göteborgs-Posten 1998 extract containing 1,000,504 words, the included checks produced 374 useful alarms and 160 false alarms, giving 70% precision. A separate recall assessment used 87,713 words from the same newspaper source. The linguists identified 135 grammatical errors, of which 55 belonged to categories targeted by Grammatifix. The checker detected 47: recall was 85% within its target categories and 35% across all identified categories. Those results support a bounded conclusion. Explicit contextual rules can detect a substantial share of the errors they are designed to find, but strong performance within that scope does not amount to comprehensive checking.

Interesting ideas

Treat uncertain analysis as usable evidence. A downstream decision need not wait for every ambiguity to disappear. Grammatifix can require that all surviving interpretations belong to a permitted group while also requiring that a particular interpretation remains available. This distinguishes controlled uncertainty from unrestricted confusion. The same approach can help information extraction and other linguistic applications that must act on incomplete analysis without pretending that it is definitive.

Adapt interpretation to defective input. An analyzer designed around grammatical sentences may prefer an unintended reading precisely because the intended reading exposes a mistake. The paper responds by selectively changing disambiguation behavior for known error patterns. This idea applies wherever input violates the assumptions of an upstream component: diagnose how the violation changes the representation before assuming that the final decision rule is at fault.

Let each check gather the structure it needs. Grammatifix avoids requiring a complete syntactic analysis before every check. A rule can inspect nearby words, search farther away, and connect conditions around an intermediate anchor. This is useful when a narrow decision needs a reliable fragment of structure instead of an interpretation of the whole sentence. The cost is that repeated structural work must remain understandable and maintainable across the rule collection.

Use ordinary text to discover negative cases. Error examples explain what a rule should detect, but mostly correct text reveals what it must leave alone. The authors refine broad rules by inspecting their alarms in published writing. This can expose names, idioms, and construction boundaries that an engineer did not anticipate. The principle transfers to any detector whose positive pattern also occurs in legitimate material.

Keep local competence separate from overall coverage. Reporting recall only on supported categories answers whether the implementation meets its stated scope. Reporting recall across all observed errors answers how much assistance a user actually receives. Both are needed because a reliable narrow system and a broad but unreliable system present different engineering problems. The same distinction matters whenever a tool supports a selected inventory of cases.

Attribute failures to the responsible stage. The paper separates problems originating in lexical information, disambiguation, and final detection rules. A superficially identical false warning may require a different repair depending on where it began. This kind of analysis prevents teams from expanding downstream exceptions to compensate indefinitely for upstream defects, and it gives evaluation a practical role in deciding what to improve next.

Deep dive: Detecting grammar errors with Lingsoft's Swedish grammar checker

How Lingsoft’s Swedish grammar checker uses contextual rules, handles ambiguous words, limits false alarms, and measures detection. · about 34 minutes to read

How Mova uses it

Mova is a small, transparent language system implemented in Rust. Its documented mechanisms include explicit linguistic rules, grammatical analysis, corpus review, and separate evaluation paths. These provide concrete connections to the paper, but they do not establish that Grammatifix’s design has been reproduced or that its Swedish results transfer to Mova. The status marks below identify proposed relationships to documented mechanisms. They are not application measurements, and the available account of Mova is incomplete.

Idea: Treat uncertain analysis as usable evidence. Where: section 2.3, rules accepting ambiguity. Area: syntax. Mova: частково є (en/src/french_rules.rs, closed evidence requirements and abstention). Grammatifix permits a constrained collection of readings rather than demanding a single interpretation everywhere. Mova could make a similar distinction between uncertainty that blocks a decision and uncertainty that leaves the decision unchanged. Its French overrides already decline unsupported cases, but an equivalent interface over alternative readings is not established. A useful experiment would compare decisions made from a single selected analysis with decisions admitted across a declared set of compatible analyses.

Idea: Adapt interpretation to defective input. Where: section 2.3, changes to disambiguation. Area: syntax. Mova: частково є (en/src/french_rules.rs; en/seeds/french-parse). Mova already applies formal French repairs using lexical and morphological evidence. The paper suggests extending the diagnostic question: does an upstream choice remove the interpretation needed to recognize a downstream problem? A proposed repair should preserve evidence for the intended construction without forcing every suspicious sentence into it. The recorded French applications concern their stated parsing tasks; they do not establish performance on grammatical error detection.

Idea: Let each check gather the structure it needs. Where: section 2.2, contextual conditions replacing a separate parsing stage. Area: syntax. Mova: частково є (en/src/french_rules.rs, construction-specific rules). Grammatifix demonstrates how a narrow check can collect sufficient structural evidence without requiring a complete analysis first. Mova’s main readers use dependency trees and frames, so this is a possible supplementary path for bounded checks, especially when a full tree is unreliable. The proposed use would need a clear interface between observations from a local rule and observations from the normal tree-based path.

Idea: Use ordinary text to discover negative cases. Where: chapter 3, corpus-based rule refinement. Area: evaluation. Mova: частково є (tools/treeagree, corpus agreement and validation; documented regression gates). Mova already checks proposed linguistic changes, but the paper’s particular contribution is to make legitimate occurrences of a suspicious pattern central to rule development. A Mova repair could retain examples where it should fire alongside naturally occurring examples where it must abstain. This would test whether a successful repair captures the intended construction rather than merely matching a convenient word sequence.

Idea: Keep local competence separate from overall coverage. Where: chapter 4, recall within targeted categories and across all categories. Area: evaluation. Mova: частково є (docs/school.md and the documented assessment boundaries). Mova distinguishes configured capabilities from broader task understanding. The paper suggests making that distinction visible in every suitable evaluation: report success within the declared inventory and coverage against an independently identified inventory of needs. This would prevent a strong score on supported cases from being read as a claim about unrestricted understanding. Equivalent category-based reporting for every Mova component is not established.

Idea: Attribute failures to the responsible stage. Where: chapter 4, sources of false alarms and missed errors. Area: analysis. Mova: вже є (world/src/knowledge/retention/fastread.rs, miss classification by representation, inference, parameter, and parse). Mova’s fast-reading analysis already separates kinds of failure rather than treating every wrong answer as the same event. Grammatifix reinforces the value of this mechanism for linguistic checks: a lexical omission, an interpretation mistake, and an overbroad rule need different remedies. The categories need not be identical across applications, but they should point to an actionable component.

Idea: Recognize fixed expressions before applying productive grammar checks. Where: section 2.1, preprocessing; chapter 3, the temporal expression discussed during refinement. Area: data processing. Mova: частково є (prag, idioms and expressions interpreted by meaning). Grammatifix uses lexical units to prevent a component of a fixed expression from misleading a later rule. Mova already has expression handling, but the paper suggests explicitly checking whether that handling protects downstream morphological and syntactic decisions as well as interpretation. The relevant boundary is between a stored expression and an ordinary sequence to which productive rules apply.

Idea: Separate grammatical detection from other writing checks. Where: chapter 1, distinct treatment of grammar, writing conventions, and marked vocabulary. Area: architecture. Mova: частково є (docs/architecture.md, distinct linguistic responsibilities and domain routing). Mova’s components already have declared jobs. A future writing assistant could preserve that discipline by giving a grammar judgment a different evidence type from a formatting warning or lexical style observation. This matters because a recommendation about preferred wording should not acquire the authority of an identified grammatical contradiction merely by appearing in the same interface.

Idea: Retain a harmless default when no rule establishes a problem. Where: section 2.1, final selection of @OK. Area: decision logic. Mova: частково є (tools/octopus, unsupported requests retain explicit failure; French overrides abstain on unknown evidence). Mova already avoids inventing actions or repairs without sufficient evidence. Grammatifix offers a related but narrower convention: an unflagged word has passed without an alarm, rather than receiving a proof of correctness. A Mova grammar-checking interface should preserve that distinction in both its internal state and its wording to the user.

Idea: Bind an explanation to the rule’s actual evidence. Where: section 2.1, rule-linked messages and contextual slots. Area: interpretability. Mova: вже є (global explanations; world answers with reasons). Mova already retains reasons for native conclusions. The paper provides a concrete interface pattern for extending this to grammatical feedback: populate an explanation from the words and features that satisfied the rule. Such a message would let a reviewer inspect whether the system identified the right construction, rather than merely seeing a generic warning attached to the wrong location.

Idea: Keep correction generation distinct from detection. Where: section 2.1, optional correction schemes. Area: grammatical correction. Mova: нове. Mova could represent an admitted error observation separately from an admitted replacement, since knowing that a form is unsuitable does not always determine what the writer intended. Why Mova: this would let a transparent checker give useful diagnoses while withholding a replacement that lacks sufficient support. A dedicated correction interface is not established by the documented mechanisms, so this status is a proposal rather than proof that no related work exists.

Idea: Use written forms as a bounded fallback. Where: section 2.3, word-form-specific error rules. Area: morphology. Mova: частково є (en/src/french_rules.rs, closed lexical domains). Grammatifix sometimes recognizes a construction through a particular form after disambiguation has discarded the intended grammatical reading. Mova could use this strategy when a small lexical inventory gives stronger evidence than an unreliable upstream tag. The fallback should remain explicit about which grammatical interpretation it bypasses and why, rather than silently treating all surface matches as equivalent.

Idea: Preserve the interpretation needed to explain an error. Where: section 2.3, the adjective–noun ambiguity illustrated by kall. Area: linguistic representation. Mova: частково є (en/src/french_rules.rs, formal overrides using morphology and lexical classes). The paper distinguishes analysis that makes the observed sentence look grammatical from analysis that explains the writer’s likely construction. Mova could retain a diagnostic alternative when a known error pattern would otherwise eliminate it. This is a hypothesis about representation, not authorization to infer intention without constraints.

Idea: Place ambiguity requirements on individual conditions. Where: section 2.2, careful-mode conditions. Area: decision logic. Mova: нове. A future Mova rule interface could declare that a particular condition requires unanimous support across available readings while another condition only requires a compatible reading. Why Mova: condition-level requirements could expose exactly which uncertainty prevents a rule from firing, making abstention easier to inspect. Mova’s existing conservative rules are related, but a general interface with these semantics is not established.

Idea: Connect distant conditions through explicit anchors. Where: section 2.2, linked searches. Area: syntax. Mova: частково є (prag frames and dependency-based readers). Mova already connects grammatical roles through structure. Grammatifix suggests an additional form of bounded evidence: locate an anchor, then evaluate a second condition relative to that anchor. A native check could retain these anchor identities in its reason, allowing inspection of which auxiliary, clause introducer, or phrase boundary licensed the conclusion.

Idea: Make exclusions specific to the construction. Where: chapter 3, successive refinements for genitives, titles, and clause contexts. Area: rule engineering. Mova: частково є (en/src/french_rules.rs, closed construction rules; regression-gated changes). The paper shows why a broad exception can suppress valid detections outside the case that motivated it. Mova could require each exclusion to identify both the legitimate construction it protects and the intended detections it might block. Existing regression practice supports that approach, but a complete exception-management mechanism is not established.

Idea: Repair lexical evidence instead of accumulating downstream workarounds. Where: chapter 4, the discussion of partnerskap; chapter 3, handfull. Area: lexicography. Mova: частково є (tools/dictindex, source-bound examples and reviewed labels). Mova’s dictionary index already provides attributed occurrences for review. Those occurrences could help determine whether an apparent rule problem is actually a missing grammatical reading or an inadequate lexical classification. Statistical evidence would remain a proposal for review; it would not automatically become an admitted dictionary entry.

Idea: Review corrections in successive unseen text portions. Where: chapter 3, refinement across corpus parts. Area: evaluation design. Mova: частково є (docs/training.md, held-out gates and experiment journals). The transferable idea is to check a revised rule on material beyond the examples that caused the revision. Mova already uses held-out evaluation, and the paper supplies a concrete motivation for applying that discipline to individual linguistic exceptions. A successful fix on its originating sentence should not be treated as evidence of general reliability.

Idea: Separate factual detection from editorial acceptability. Where: chapter 4 and the notes on verb chains and subordinate-clause word order. Area: evaluation and user communication. Mova: нове. A writing component could distinguish a directly observed grammatical property from a recommendation associated with formal style. Why Mova: this would preserve the system’s explanatory discipline when acceptable usage varies and would make assessment labels easier to interpret. The proposed distinction concerns grammatical feedback; it is not established by Mova’s more general ability to retain sources and reasons.

Idea: Measure the cost of protective conditions. Where: chapter 4, missed errors caused by restrictive safeguards. Area: evaluation. Mova: частково є (docs/training.md, measured changes and negative controls). A safeguard that reduces false positives may also remove genuine successes. Mova could record both effects when admitting a new exclusion, retaining the protected negative examples and the newly missed positive cases. This extends existing regression principles to the specific tradeoff examined in the paper, without assuming that a lower warning count is automatically better.

The problem and its context

Grammar checking differs from checking whether a written form belongs to a dictionary. A word may be perfectly ordinary on its own yet unsuitable beside other words. An article can have the wrong gender for a noun. An adjective can have an incompatible number or definiteness form. A verb can appear in a form that does not fit the surrounding auxiliary sequence. Detecting these problems requires evidence beyond the isolated word, but the necessary amount of context varies considerably.

The paper treats this as a bounded engineering problem. It does not begin with the expectation that a complete grammatical account of Swedish can immediately become a reliable checker. Instead, it argues for selecting central categories and recurring patterns whose conditions can be stated precisely. This is an important restriction on the intended result. The system’s task is to identify supported kinds of problems in unrestricted text, not to decide whether every sentence is grammatical in every respect.

For the broader development choices, Birn refers to Antti Arppe’s Developing a grammar checker for Swedish. That companion contribution addresses the product’s general design and the background of Swedish grammar checking. Birn concentrates on the mechanics of detection: what representations are produced, how contextual rules recognize errors, and how those rules are made less disruptive in practice. The papers therefore address related questions at different levels rather than supplying competing implementations.

Constraint Grammar supplies the technical starting point. The paper describes it as a framework for part-of-speech tagging through disambiguation and for limited syntactic analysis. Its normal operation begins with alternative grammatical readings and uses contextual constraints to narrow them. Grammatifix reuses this machinery but changes what its later stages decide. Instead of selecting among ordinary syntactic labels, the application selects an error label.

That reuse creates an opportunity and a difficulty. The opportunity is that a rule language already capable of describing grammatical context can express conditions for error detection. The difficulty is that ordinary disambiguation relies on the grammatical regularities that an error may violate. If an analyzer assumes that the surrounding words form a legitimate construction, it may select an interpretation that hides the defect. The paper makes this interaction a central subject instead of treating disambiguation as a completed preliminary operation.

Earlier approaches mentioned in the paper provide another point of comparison. Birn notes the common assumption that error detection should follow some amount of parsing, at least in the portion of a sentence where the checker expects a problem. For instance, agreement checking might appear to require noun phrases to be recognized first. The cited discussion includes chart-based checking, finite-state approaches, and other grammar-checking systems. The paper does not present a controlled evaluation against them. Its architectural distinction is that Grammatifix’s error rules perform the relevant structural work themselves.

The application also has a practical audience in mind. Frequent false warnings make a language checker tiresome. This gives correct text an essential role in development: the checker must show not only that it can find a defective pattern but also that it can recognize legitimate contexts resembling that pattern. Published prose is useful for this purpose because unusual but acceptable combinations still occur even when the overall text has been professionally produced.

Finally, “error” is not wholly independent of editorial judgment. Some targeted constructions are straightforward grammatical violations, while others concern forms that some writers accept but that the checker discourages in polished prose. The paper acknowledges this explicitly. The task therefore includes selecting a norm, communicating its status, and evaluating whether a warning is useful under that norm. A count of detected constructions cannot settle those questions on its own.

The method, step by step

The architecture is easiest to understand as a progression from possible analyses to a narrowly justified warning. Early stages determine what the text could mean grammatically. Later rules ask whether a particular arrangement supports an error diagnosis. The final output is therefore based on a chain of decisions, and a failure anywhere in that chain can affect the warning.

From Swedish text to a grammatical warning

The steps in order.

From Swedish text to a grammatical warningStep 1: Identify words and fixed expressions1. Identify words and fixed expressionsStep 2: Generate possible grammatical readings2. Generate possible grammatical readingsStep 3: Reduce ambiguity using contextual rules3. Reduce ambiguity using contextual rulesStep 4: Attach error and acceptable alternatives4. Attach error and acceptable alternativesStep 5: Select warnings and associated explanations5. Select warnings and associated explanations

Establishing the lexical units

The first stage performs tokenization. It recognizes words, abbreviations, punctuation, and certain fixed expressions. This is more consequential than simply separating text at spaces. If an expression functions as a lexical unit, analyzing each component independently can introduce grammatical features that later checks should never use.

The paper illustrates this with till hands. Grammatifix treats the expression as an adverbial unit. Without that treatment, a component could contribute apparent genitive information and lead an agreement rule to make an irrelevant connection. The preprocessor therefore protects later analysis by choosing the right units before grammatical readings are assigned.

The same issue returns during the discussion of false alarms. A temporal expression containing a form that resembles a genitive can stand between other constituents without governing them. If the checker treats that apparent genitive as an ordinary member of a nearby noun phrase, it can invent a definiteness problem. Recognizing the expression earlier is potentially cleaner than adding another exception to every rule affected by it.

This use of multiword expressions is narrowly functional. The paper does not propose that all idiomatic language must be resolved before checking begins. It shows that a known lexical expression can prevent a specific kind of misleading morphological evidence. The preprocessing decision and the error rule are connected through the information the rule is allowed to inspect.

Generating grammatical alternatives

SWETWOL performs lexical analysis. Its output contains possible readings for each lexical unit, including a base form, a grammatical category, and features such as number, gender, definiteness, and case. These are alternatives, not simultaneous assertions that every reading applies in the sentence.

The sequence involving många and engelska demonstrates why this distinction matters. The former has determiner and pronoun possibilities. The latter can be an adjective but also has a singular noun reading. A checker that combines a plural interpretation of the first word with the singular noun possibility of the second could report a number mismatch in an acceptable expression.

The error would arise from the checker’s use of alternatives, rather than from the writer’s grammar. Lexical analysis has correctly reported what forms are possible in general, but a later decision has treated an inappropriate combination as if it described the sentence. Contextual disambiguation is necessary to prevent that kind of false alarm.

The paper’s feature notation makes these decisions explicit. N denotes a noun and A an adjective. Number is represented through SG and PL; definiteness through DEF and INDEF. The Swedish gender distinction appears through NEU and UTR. These labels give the rules compact access to distinctions that matter for agreement without requiring the rule to reason directly over whole written words every time.

Reducing ambiguity without demanding perfection

The disambiguation stage mostly adopts the rules of SWECG, Swedish Constraint Grammar. In the illustrative acceptable sequence, it retains the plural adjective interpretation needed to avoid the spurious agreement warning. Its purpose in Grammatifix is practical precision, however, rather than complete elimination of every ambiguity.

That distinction changes how the rest of the architecture is designed. Some downstream rules tolerate remaining alternatives. Others continue to work even when the chosen interpretation is known to be unsuitable. Still others depend on changes to the disambiguator. Grammatifix does not impose a single policy that all uncertainty must be resolved upstream before error detection can begin.

The paper reports some 50 differences between the disambiguation rules used in Grammatifix and the original SWECG rules. It explains that the fallback strategies reduce the need for still more changes. This is evidence of selective adaptation: the checker retains the existing framework wherever possible, then intervenes where error-bearing text predictably defeats its assumptions.

Turning grammatical information into an error decision

After disambiguation, every remaining reading receives @ERR and @OK. At this point neither tag constitutes a final judgment. They are alternatives made available for the application-specific selection stage.

The error rules then select @ERR where their conditions hold. In the paper’s main example, a genitive governs a noun phrase containing an adjective and a noun. The noun appears in a definite form where the construction requires an indefinite form. The rule marks that noun rather than indiscriminately flagging all words involved in the construction.

Once the error rules have been tried, the remaining words receive @OK. This default is operationally convenient, but its meaning must remain limited. It records that the available checks did not establish an error at that word. It cannot certify that the sentence contains no unsupported or undetected problem.

The inventory contains 659 @ERR rules. That number describes the encoded detection grammar, not an inventory of independent grammatical principles or an estimate of language coverage. A general phenomenon can require multiple rules because different word forms, positions, and legitimate exceptions need different treatment.

Reading the contextual rule language

An error rule specifies its domain, an operation, a target tag, and contextual requirements. The domain may cover any word or a particular written form. The operation can select a tag or remove one. Contextual conditions state which grammatical sets must, or must not, occur at relevant positions.

The current word occupies position 0. Negative positions refer to words on its left; positive positions refer to its right. In the simplified definiteness example, the current word must be a definite noun, the preceding word a definite adjective, and the word before that a genitive. The significance lies in the conjunction: a definite noun is not an error by itself, but it can be inappropriate in this particular configuration.

These fixed positions are only part of the language. Unbounded conditions can search farther through the sentence. A rule checking an infinitive, for instance, can ask whether a finite verb appears anywhere on either side. The rule is not merely matching adjacent forms; it is testing whether the sentence contains the grammatical support the infinitive would require.

Negative conditions are essential here. Positive evidence identifies a potentially suspicious construction, while the absence of another feature helps establish why that construction warrants a warning. This is different from assuming that an unseen feature is absent because analysis is incomplete. The rule tests absence within the representation and search region supplied by the system.

All categories referenced in conditions must be declared as sets. A set can collect grammatical features, combinations of features, or selected lexical members. This gives the language a way to express both productive grammatical distinctions and closed classes of words whose behavior matters for a particular check.

Using ambiguity requirements precisely

A condition can operate in careful mode. Without this requirement, a condition can succeed when a word has a matching reading among its alternatives. Careful mode instead requires the available readings to remain within the specified category. A possibly nominal word and an unambiguously nominal word therefore provide different strengths of evidence.

The paper says that this mode occurs in most contextual conditions of its error rules. That choice follows the application’s priorities. If a warning depends on treating a neighboring word as a noun, it is often safer to require strong evidence for that interpretation than to flag a sentence because a noun reading merely exists.

Yet careful mode does not always mean requiring a single reading. The permitted set can itself contain alternatives. In the example involving a possible supine or participle, the rule accepts readings from that restricted family while separately requiring a supine reading to be present. A word interpreted only as a participle fails the requirement; a relevant ambiguous word can pass it.

This is a subtle but useful distinction. The rule controls the range of uncertainty and the presence of necessary evidence separately. It can tolerate precisely the ambiguity that arises in the targeted construction without accepting unrelated interpretations.

Linking searches to intermediate anchors

A rule may also connect conditions through a word found during a search. This allows it to inspect a structured span instead of independently asking whether certain categories occur somewhere in the sentence.

The modal-auxiliary example begins at a supine form. The rule searches leftward for a modal auxiliary. Once that auxiliary is located, another condition checks the interval between it and the target for an intervening verb. The warning concerns the relationship between those positions, not the accidental coexistence of an auxiliary and a supine.

The subordinate-clause word-order example builds a more elaborate chain. It connects a clause introducer, a nominal head, a finite verb, and the clausal adverb under inspection. Further conditions restrict what may intervene. These linked observations provide the structural evidence for judging the adverb’s position.

Such rules do a limited kind of syntax internally. They identify relevant anchors and boundaries without constructing a complete sentence analysis first. Birn acknowledges that this can make rule writing laborious. The attraction is that the same rule can incorporate the construction-specific exceptions needed to avoid false alarms.

Recovering from analysis distorted by errors

The word ett illustrates a case where the intended determiner interpretation has been discarded and a pronoun interpretation survives. A rule phrased only as a mismatch between determiner gender and noun gender would fail because the required determiner label is no longer present.

Grammatifix instead uses the written form as the rule’s domain and checks the following noun. This deliberately bypasses the misleading category choice. It works because the relevant surface inventory is sufficiently constrained; the system does not need to resolve every possible instance of grammatical ambiguity in the same way.

The adjective kall illustrates another route. In the defective genitive construction, ordinary disambiguation can prefer the competing noun reading because that reading makes the local sequence appear more grammatical. Grammatifix introduces a lexical set covering some 60 common adjectives with this kind of ambiguity and adjusts their interpretation in the specified context.

The result is that the existing adjective-error rule can operate on these cases. Rather than inventing a different final diagnosis for each ambiguous word, the system restores the reading that the diagnosis needs. The intervention remains restricted by the surrounding grammatical conditions.

Producing feedback and refining the rules

Each error rule is associated with an error title, an explanation, and, where feasible, a correction scheme. A longer grammatical explanation is also available to the user. Contextual positions in the message are filled with the words that triggered the rule.

For the definite noun following a genitive, the correction scheme requests an indefinite form of the noun. This links the grammatical explanation to a specific change. The scheme is optional in the general architecture, which matters because detecting an unsuitable construction does not always determine a safe replacement.

The rules were refined through corpus inspection rather than learned from a reported statistical training procedure. The development corpus contained 1.6 million words, mainly published newspaper and periodical material. It was divided into five parts. Alarms were inspected, the rules were revised, and the revised rules were then applied to the next portion.

This process made legitimate counterexamples part of development. Capitalized titles, temporal expressions, quantity constructions, and clause-level uses of common words all forced the basic patterns to become more selective. The paper presents that detailed exception work as central to practical quality, not as incidental cleanup after the main method.

Experiments and results

The performance tests used text that had not previously been processed during development. The paper evaluates precision and recall separately because they answer different questions and require different annotation procedures. Precision asks whether emitted warnings deserve attention. Recall asks how much of the independently identified error inventory the checker finds.

Precision = good alarms / all alarms

Precision is the proportion of emitted alarms judged appropriate. “Good alarms” are warnings accepted under the evaluation’s grammatical and editorial criteria. “All alarms” includes those accepted warnings and the false warnings. The metric therefore measures the reliability of what the checker chooses to show.

Recall = detected errors / all errors

Recall is the proportion of annotated errors that the system identifies. “Detected errors” refers to items in that annotated inventory found by the checker. “All errors” must be interpreted with an explicit scope: the paper reports a denominator restricted to targeted categories and another covering the entire annotated inventory.

Precision on running newspaper text

The precision test used 1,000,504 words from Göteborgs-Posten 1998. The authors ran the grammatical detection rules over the text and examined the resulting alarms. This is materially different from testing only sentences already known to contain a supported error. In mostly correct prose, every unnecessary warning becomes visible.

The reported result was 70% precision, based on 374 good alarms and 160 false alarms. The paper does not offer a directly comparable competing system. Birn consequently avoids declaring the figure strong or weak against an established benchmark and notes that performance on other kinds of text remains unknown.

The accepted alarms demonstrate that ordinary published writing still contains the kinds of local problems the checker targets. Among them, 134 involved agreement inside noun phrases. Verb-form compatibility accounted for 176 good alarms, including 99 cases of a supine occurring without ha. These counts also show why the evaluation’s editorial criteria matter: some targeted constructions concern recommendations for polished writing rather than judgments accepted identically by everyone.

The headline precision test excluded the categories concerned with absent verbs and absent finite verbs. Grammatifix can identify those properties, but their occurrence frequently reflects an acceptable fragment instead of a grammatical fault. Including them without qualification would mix reliable property detection with useful error detection.

The notes give a separate analysis of the missing-finite-verb category. There were 321 alarms, of which 312 correctly identified the relevant property, producing 97% precision for that alarm type. The broader missing-verb category generated 7145 alarms. These figures should not be confused with evidence that all such sentences needed correction.

Recall against independently identified errors

For recall, the test material contained 87,713 words from Göteborgs-Posten 1998. Birn and Eva Orava read the text, marked grammatical problems, and discussed uncertain cases. This procedure sought an inventory independent of the checker’s alarms, allowing missed errors to be observed.

They identified 135 errors. Agreement problems accounted for 31, including 22 within noun phrases and 9 involving other relations. Verb-form compatibility contributed 28, and preposition problems 26. The inventory also contained 21 cases involving missing or unnecessary endings, 8 separated compounds, 8 sentence-structure problems, 3 word-order problems, and 10 other cases.

Only 55 of those errors belonged to the categories Grammatifix aimed to detect. Within that subset, the largest groups were noun-phrase agreement violations, with 22 cases, and verb-chain compatibility violations, with 21. The checker found 47 targeted errors.

Grammatifix recall on Göteborgs-Posten 1998 under different category scopes

Stronger recall within supported categories coexists with much narrower coverage of the full error inventory.

Grammatifix recall on Göteborgs-Posten 1998 under different category scopesAll annotated error categories: 35All annotated error categories35Targeted error categories (this paper): 85Targeted error categories (this paper)85
The numbers
System or settingrecall %
All annotated error categories35
Targeted error categories (this paper)85

The chart compares denominators for the same detector, rather than competing implementations. The targeted-category result measures how successfully the rule inventory performs its declared job. The all-category result measures how much of the observed grammatical need that inventory addresses. Neither should replace the other.

The paper identifies 8 missed errors within the targeted categories. Of these, 5 were attributed to restrictions intended to prevent false alarms. This makes the cost of conservative rule design visible in the recall results themselves.

Understanding the false alarms

The analysis of 160 false alarms assigns 46 to lexical omissions or errors, 18 to disambiguation mistakes, and 96 to insufficiently accurate error-selection rules. These are broad diagnostic categories rather than measurements of isolated components under controlled replacement.

The lexical example concerns partnerskap. Its available number information caused an acceptable plural context to look inconsistent. Adding the appropriate plural possibility would remove that warning at its source. This is a different repair from weakening the agreement rule for every noun.

Some false alarms are less tractable. Elliptical constructions can place words next to each other even though omitted material determines their true grammatical relationships. The checker may mistake such a sequence for an ordinary noun phrase and apply an agreement rule to the wrong structure.

The results therefore point to several engineering tasks at once. Lexical maintenance can repair missing readings. Disambiguation changes can preserve relevant interpretations. Better contextual restrictions can reduce overbroad warnings. But not every false alarm can be removed through a sufficiently narrow and economical rule change.

What the evaluation does and does not compare

The paper’s quantitative evidence concerns Grammatifix’s own rule inventory, its development process, and its tested outputs. It does not establish superiority over another Swedish checker. Differences in text selection, target categories, and judgments of acceptability would make an informal comparison unsafe.

The initial development rules achieved 38% precision on the first corpus portion before refinement. That observation shows how unreliable broad pattern matching could be in ordinary text. It is not a controlled before-and-after comparison with the final newspaper test, because the evaluation material and development status differ.

The paper’s strongest empirical contribution is consequently descriptive and diagnostic. It provides real-text precision, independently annotated recall, explicit category coverage, and an account of the major error sources. Together, these make the tradeoff inspectable even without a common competitive benchmark.

What the ablations show

The paper reports no formal component ablations or controlled removal experiments.

Its analyses nevertheless explain why several design choices matter. These explanations operate through worked examples, development observations, and classified failures. They should be read as evidence about specific mechanisms, not as estimates of how much each mechanism contributes to the final score.

Disambiguation can prevent a false warning

The acceptable sequence involving många and engelska illustrates the benefit of reducing lexical ambiguity. Before contextual interpretation, the analyzer offers a singular noun reading that could conflict with a neighboring plural form. After disambiguation, the relevant adjective interpretation remains and the apparent mismatch disappears.

This example establishes the causal possibility the architecture addresses: correct lexical alternatives can become an incorrect warning if the decision procedure combines them carelessly. The paper does not measure the system with disambiguation removed, so it does not quantify the total precision benefit of this stage.

Disambiguation can also conceal a real error

The kall example reverses that relationship. An interpretation preference suited to grammatical input removes the adjective reading required by the error rule. A targeted disambiguation change restores it and allows detection.

The comparison shows that more decisive analysis is not automatically more useful analysis. What matters is whether the surviving representation supports the downstream task. It also explains why a grammar checker may need a variant of a general-purpose disambiguator rather than merely reusing its output unchanged.

The word-form strategy and ambiguity-tolerant strategy offer alternatives to rewriting that component. Their coexistence is important. Some cases are best handled by bypassing a mistaken label, others by accepting a constrained ambiguity, and others by changing the analysis that reaches the final rule.

Refinement protects legitimate constructions

The title examples show how capital letters can prevent a general genitive–definiteness rule from treating a work’s name as an ordinary governed phrase. The point is not that capitalization solves named expressions comprehensively. It is that an error pattern needs evidence about when its normal grammatical interpretation is inappropriate.

The discussion of dess reveals a further complication. Excluding it from a broad genitive rule protects an acceptable construction, but an unrestricted exclusion would also conceal genuine mistakes. A more specific rule is then needed, with its own condition protecting the fixed construction.

This is a qualitative demonstration of interacting exceptions. A local repair can create a coverage gap that another rule must fill. The paper does not measure this chain separately, but it makes clear why the final inventory cannot be understood as a collection of independent simple patterns.

Clause position changes the risk

The analysis of det distinguishes contexts where a suspicious noun phrase is relatively safe to interpret as an error from contexts where the same surface sequence has common legitimate explanations. Position before a finite verb, position after a non-finite verb, and position after a finite verb require different safeguards.

In the more difficult environments, det may have a clause-level role instead of belonging to the following phrase. Verb properties and following relative material can also change the analysis. The practical result is selective coverage: the checker handles some contexts while knowingly missing another described construction.

This analysis explains a boundary of the implementation. It does not supply a general ranking of all clause positions, nor does it quantify their respective precision. Its value is to identify the structural distinctions a more complete rule would need.

The missed-error analysis exposes the trade-off

The attribution of 5 targeted misses to protective restrictions connects the design discussion with observed evaluation failures. Conservative conditions did prevent some desired detections. The paper therefore does not portray false-alarm reduction as a free improvement.

Conversely, the ellipsis discussion shows why the authors retain some false alarms. A broad safeguard based on punctuation or coordination could suppress legitimate detections in unrelated constructions. Without a reliable way to isolate the elliptical case, adding that safeguard would simply move the problem elsewhere.

These analyses support a practical conclusion: refinement should be judged by both what it protects and what it suppresses. They do not establish an optimal balance, because the paper offers no controlled search over alternative policies or direct user-acceptance experiment.

Limitations

The authors’ stated limits on coverage

Birn explicitly presents computational grammar checking as partial. Grammatifix focuses on selected categories and relatively describable patterns. It does not claim comprehensive treatment of sentence structure, pronoun agreement across references, missing endings, or preposition choice.

This restriction matters when interpreting the recall results. The stronger targeted-category figure describes an implementation operating within its chosen scope. The much lower all-category figure reflects errors outside that scope as well as any failures within it. A user benefits from accurate local checking, but may still receive no help with many problems present in the same document.

The paper also acknowledges unfinished work within supported areas. Its discussion of det describes a construction that remains undetected even though the relevant grammatical factors can be identified. Explaining what a rule should eventually consider is not evidence that the implementation already handles it.

The authors’ stated limits on analysis quality

Some disambiguation disturbances remain unresolved. Grammar errors are not the only source of mistaken readings, and the paper does not suggest that all interpretation problems can be eliminated. The detector must therefore operate with a representation that can still contain errors or ambiguity.

The lexical analyzer also limits the final decision. A missing reading can make a good sentence appear inconsistent or prevent an error from fitting the intended rule. The partnerskap example is useful precisely because it shows that a final warning may be logically consistent with incomplete lexical information while still being wrong about the text.

The rule-specific approach does not remove the need for syntax. It relocates the necessary structural work into contextual conditions. The authors acknowledge that this can be burdensome, especially as the construction becomes less local.

The authors’ stated limits on false-alarm avoidance

Ellipsis is a declared difficulty. The checker may apply an ordinary agreement analysis where omitted material changes the relevant structure. The authors consider some such false alarms preferable to suppressing many legitimate detections through vague conditions.

That choice is a practical judgment, not proof that the remaining warnings are harmless. The paper says that users ultimately determine whether the compromise is acceptable. It does not report a user study demonstrating acceptance of the observed warning rate or of particular unresolved false-alarm types.

The phrase “reasonable” refinement also remains informal. There is no exact procedure for deciding when a safeguard removes too much useful coverage. The engineering policy is understandable, but another implementation or audience could choose a different balance.

The authors’ stated limits on evaluation

The recall sample is identified as small. It contains relatively few targeted errors, so the reported result should not be treated as a stable estimate for every supported construction. Some categories or lexical conditions may be sparsely represented.

The paper also notes the absence of agreed evaluation standards. A collection of error-bearing sentences and a continuous newspaper corpus impose different demands. The former can concentrate on supported positive cases; the latter exposes a checker to many legitimate contexts that can produce false warnings.

Judgment criteria create another source of uncertainty. Some constructions are disputed, and some warnings describe stylistic recommendations rather than universally accepted prohibitions. The paper acknowledges that systems may also target different levels of difficulty. A single precision or recall figure cannot normalize those differences.

Limits visible in the setup

A careful reader should separate those stated caveats from additional restrictions implied by the design. The precision and recall assessments use different amounts of text, with distinct annotation procedures. Their figures describe complementary tests, but they should not be treated as if they came from a single shared set of adjudicated decisions.

The evaluation relies on running text from a newspaper source. The paper does not establish performance on learner writing, informal messages, specialized documents, or other domains. The development corpus contains published material too, so the evidence is strongest for that general kind of writing.

The recall annotation involved the author and another Lingsoft linguist, who discussed uncertain cases. This is a reasonable way to build a working inventory, but the paper does not report independent agreement before discussion or an external adjudication exercise. The result depends partly on the grammatical and editorial judgments adopted by those readers.

Similarly, an alarm counted as good is not the same outcome as a successful correction. The architecture supports correction schemes, but the evaluation does not separately measure whether suggested replacements preserve intended meaning, whether users accept them, or whether they improve complete documents.

Limits on causal and comparative claims

The paper describes an implemented system and reports its performance, but it does not isolate the contribution of preprocessing, careful-mode conditions, lexical fallbacks, or altered disambiguation through controlled experiments. Worked examples make these mechanisms intelligible without determining their aggregate value.

There is also no direct baseline establishing that embedding limited syntax inside error rules is better than supplying those rules with a separate parser’s output. The architecture demonstrates feasibility. Claims about relative development cost, accuracy, or maintenance would require a comparison that the paper does not provide.

The same caution applies to the rule inventory’s size. The existence of 659 error rules shows substantial implementation work, but it does not reveal how evenly coverage is distributed, how often rules overlap, or how expensive future maintenance would be. Those are natural questions raised by the design, not measurements reported by the authors.

Finally, the 70% precision figure is conditioned on the included alarm categories. Excluding the missing-verb categories is justified because detecting a sentence property does not necessarily identify a defect. Nevertheless, the exclusion remains part of the result’s scope and must accompany any interpretation of that headline number.

What came after

No subsequent citing work is documented in the available account of this paper’s research lineage. A specific successor, extension, or later result therefore cannot be attributed to Grammatifix on this evidence. The companion contribution by Arppe belongs to the same development context; it is not evidence of a later system building on Birn’s results.

The paper itself leaves a clear set of engineering questions for further work. These include preserving useful interpretations in defective text, recognizing legitimate contexts without losing desired detections, and evaluating both supported-category competence and broader coverage. They are open directions arising from the implementation and tests, instead of a documented history of later adoption.

Its lasting methodological value can be stated without inventing that history. A grammar checker needs more than a collection of plausible error patterns. It needs a representation that survives imperfect input, explicit reasons for accepting or withholding a warning, and evaluation that reveals both unnecessary alarms and unsupported needs. Grammatifix makes those requirements concrete through its rule language, its detailed exception analysis, and its separately scoped performance tests.

Cite

Cite as Juhani Birn. 2000. Detecting grammar errors with Lingsoft's Swedish grammar checker. Proceedings of the 12th Nordic Conference of Computational Linguistics (NODALIDA 1999).

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{juhani2000detecting,
  title = {{Detecting grammar errors with Lingsoft's Swedish grammar checker}},
  author = {Juhani Birn},
  booktitle = {Proceedings of the 12th Nordic Conference of Computational Linguistics (NODALIDA 1999)},
  year = {2000},
  url = {https://aclanthology.org/W99-1003/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/birn-2000-detecting-grammar-errors-lingsoft-s/